Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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

Your command/script should not popup any countdown window. It actually should not popup any window at all.

To create the log, use /log command-line switch:
https://winscp.net/eng/docs/commandline#logging
aceinc

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
martin

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.
aceinc

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.