WINSCPPORTABLE returning control before file downlaod completed

Advertisement

MDHutch
Joined:
Posts:
1
Location:
West Sussex

WINSCPPORTABLE returning control before file downlaod completed

I am using the latest version of winscpportable V 5.9.2 build 6958
I am calling it from a batchfile run on a windows 8.1 64bit desktop using the following syntax

call %WINSCPEXENAME% %PROFILE_NAME% /Script="%SCRIPT_FOLDER%%SCRIPT_FILE_NAME%" /log="%LOG_FOLDER%%LOG_FILE_NAME%"
where %WINSCPEXENAME% is WinSCPPortable.exe

Problem
winscpportable is kicking of the file download and immediately returning control back to the batch file before the file download has completed.
As the following task is a vbscript that processes the downloaded file this causes real problems.

The older non portable versions of winscp I have used
called using exactly the same commandline above from a batch file
kick off the file transfer and retain control (cmdline window stays open) until the file transfer has completed THEN returns control back to the batch file so that when the next script runs it knows the winscp part of the process has completed.

is there any switch I can apply when scripting using winscpportable to force it to retain control of its process until all the file transfers in the session have completed?

Please note the immediate return of control is NOT because I am using "call" or "start" etc in the batch file in the above example.

As our company has rules about what you can "install" on desktops I am forced to use the portable option and no I dont have access to a server.

Any Help or advice would be apreciated.
I have scanned FAQ, this forum and Google etc but not found any answers.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,469
Location:
Prague, Czechia

Re: WINSCPPORTABLE returning control before file downlaod completed

We have nothing to do with WinSCPportable.exe here.

The proper winscp.exe behaves as you want. And the proper WinSCP is portable too anyway, no need to use the 3rd part "WinSCP portable" project.
https://winscp.net/eng/docs/portable

Though in general, you should use winscp.com from a batch file, instead of the winscp.exe.

See https://winscp.net/eng/docs/executables

Also I do not see why you use the call command to launch winscp.exe.

Reply with quote

Guest

Firstly apologies as I had not realised winscpportable was not produced by yourself as it appears to display your properties dialogue.

Regarding the use of winscp.com V winscp.exe when called from batch files.
Unfortunately using the .com always displays a console window and there seems no way to suppress this.
I use Winscp.exe without the /console switch as per your guide and it therefore doesnt display the gui window at all which is perfect for the scheduled jobs I run

Regarding the use of "call" in my batch files to launch Winscp. I have had problems in the past simply trying to start Winscp.exe directly from a batchfile even if using CD to be in the Winscp directory first and using "call" got round that. I cant remember now what the problem was as it was several years ago with a very early version of Winscp and using "call" has never given me any issues. I will try the latest version of Winscp without it now that you have mentioned it.
Many Thanks

Reply with quote

martin
Site Admin
martin avatar

Anonymous wrote:

Unfortunately using the .com always displays a console window and there seems no way to suppress this.
No, the winscp.com inherits a console of the parent batch file.

Reply with quote

Advertisement

You can post new topics in this forum