Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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: winscp.cmd with script and log file parameter - if script file is missing, fails to log failure

The log file logs a session. If you do not start any session, nothing is logged. Conversely, a single instance of WinSCP can produce multiple logs, if multiple sessions are opened. So it's by design.

Capture winscp.com output, if you need to handle even cases like this.
See https://winscp.net/eng/docs/guide_debugging_scheduler#output
dadeniji

winscp.cmd with script and log file parameter - if script file is missing, fails to log failure

When we issue the command pasted below:-
"C:\Program Files (x86)\WinSCP\Winscp.com" -script="hello_missing.scp" /loglevel="*" /log="SFTP.log"

Console Output
Cannot open file "C:\tmp\hello_missing.scp". The system cannot find the file specified

Unfortunately, because the file is missing the log file is not created.

Please log to both the console and indicated log file.

Failing to log into the log file makes it a bit more difficult to track backend (batch) jobs; that failed due to incorrectly specified script files.