Capturing Error Code Output
How do I capture the WinSCP exit code through the command line? I want to redirect to a text file, and then read the file afterward to determine if my file transfer was successful. Here is the line of code that is only generating a blank file:
The
stream.WriteLine "WinSCP\winscp.exe /console /script="script.txt 2> error.txt"
script.txt
is referenced by my batch file, and the error.txt
is the file I want the code 0 or 1 output to.