Contents » Using WinSCP » Guides » Scripting/Automation »

Debugging Transfer Task Running in Windows Scheduler, SSIS or Other Automation Service

If your transfer automation task running under Windows Scheduler, SSIS or similar service does not work, it may not be immediately obvious what is wrong. Particularly because output of WinSCP process is hidden.

Testing the Task Independently

First step in debugging, is to make sure the task works when executed independently. Execute the exact command that you have configured in Windows Scheduler/SSIS in Windows Command prompt.


For example, if in Windows Scheduler you have "C:\Program Files (x86)\WinSCP\WinSCP.exe" in Program/script and /script="c:\script\example.txt" in Add arguments, try to execute following full command in Command prompt:

"C:\Program Files (x86)\WinSCP\WinSCP.exe" /script="c:\script\example.txt"

If the task works correctly from Command prompt, see My script works fine when executed manually, but fails or hangs when run by Windows Scheduler, SSIS or other automation service. What am I doing wrong?

If the task fails even when run from Command prompt, inspect a console output of the task for any error. If you see an error, check list of common error messages or search this website for the error. To check for an error in console output, it is recommended to use

If the problem is not obvious from the output, enable logging to a file as described below.

Inspecting Log

Next step is to enable logging to file (you should have logging enabled anyway) and inspect the log. Use /log command-line parameter.

For example in Windows Scheduler the Add arguments may look like:

/script="c:\script\example.txt" /log="c:\script\example.log"

Full command to be executed from Command prompt is:

"C:\Program Files (x86)\WinSCP\WinSCP.exe" /script="c:\script\example.txt" /log="c:\script\example.log"

If you know that the task failed with exit code 1, see Why is WinSCP returning non zero exit code? to learn what to look for in the log.

Further Reading

  guide_debugging_scheduler.txt · Last modified: by martin

Search Documentation

This page


About donations

$9   $19   $49   $99

About donations



Site design by Black Gate