How can I force Command line to write errors to STDOUT or STDERR?

Advertisement

aceinc
Joined:
Posts:
3

How can I force Command line to write errors to STDOUT or STDERR?

In testing a command line script when an error occurred it seemed to pop up a window with a countdown timer. This will be a problem in production when running from the task scheduler.

I am using 5.15 Build 9365 and executing C:\Program Files (x86)\WinSCP\WinSCP.exe.

I would like to be able to get back errors as text written to STDOUT or STDERR, how do I do this.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,603
Location:
Prague, Czechia

Re: How can I force Command line to write errors to STDOUT or STDERR?

WinSCP.exe is a GUI application. It has no stdout nor stderr.
Use WinSCP.com:
https://winscp.net/eng/docs/executables

Though if you use WinSCP.exe for scripting, it should not popup a "window with a countdown timer" anyway. You are probably doing something wrong. If you want us to investigate further, post a session log file or at least an example of your command-line.

Reply with quote

aceinc
Joined:
Posts:
3

Re: How can I force Command line to write errors to STDOUT or STDERR?

I would post a session log, but I do not know how to create one. How can I create one?

Here is the command line & script;

"C:\Program Files (x86)\WinSCP\WinSCP.exe" /script="D:\MyFolder\SFTPPutScript.txt"
open "sftp://MyUser:MyPassword@My.SFTPDomain.com/"
put D:\MyFolder\RequestFiles\MyRequest-%1.txt incoming/MyRequest-%1.txt
exit

Reply with quote

Advertisement

You can post new topics in this forum