The call
command executes the command on the server.
You cannot execute local commands from WinSCP script.
But you can execute WinSCP from a batch file and take a screenshot from the batch after WinSCP finishes. Make sure that you execute the winscp.com
(not the winscp.exe
). The winscp.com
is a console application. It inherits the console of the parent batch, so you do not loose WinSCP output after it finishes.
winscp.com /script.txt
%some_path%\test.bat
Anyway, I do not really understand the purpose of this. Wouldn't it be better, if you redirect the output of the winscp.com
to a log file?
winscp.com /script=script.txt > output.txt
Or maybe even better, use a log file (the /log=<path>
command line parameter). The log includes whole output of the WinSCP console, and lot more.