Topic "Wrong return value when using /command option"

Author Message
[View user's profile]

Joined: 2010-12-17
Posts: 1
Location: Denmark
The return value is probably as it should be - I just fail to understand why. Sad

My computer is Windows Server 2003 X64
My version of WinSCP is 4.2.9

When I use the command option in WinScp I would expect the return value to be 1 if just one of the commands are invalid. It doens't seem to be the case however.

Below is a (extremely) simple example:

C:\winscp429>WinSCP.exe /console /command "sds" "exit"
C:\winscp429>echo %errorlevel%

The first command is invalid, but still winScp returns 0 - can someone please explain why.
How can I be sure my dynamic scripting worked as planed?
I get the same result in a more advanced case where I connect to a sftp site with an invalid privatekey.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
You need to use instead of .exe.
Martin Prikryl

Ohhhh Great
I thought .exe with /console was the same as .com
Now it works


You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License