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

Advertisement

dadeniji
Joined:
Posts:
1

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.

Reply with quote

Advertisement

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

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

Reply with quote

Advertisement

You can post new topics in this forum