Capturing Error Code Output

Advertisement

victorme
Joined:
Posts:
5

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:
stream.WriteLine "WinSCP\winscp.exe /console /script="script.txt 2> error.txt"
The script.txt is referenced by my batch file, and the error.txt is the file I want the code 0 or 1 output to.

Reply with quote

Advertisement

victorme

Re: Capturing Error Code Output

Nope, not using VB.NET, using VBA. The Process object does not exist in VBA, at least not with the libraries available.

So is there not any way to redirect the exit code to a text file if I simply wanted to manually type commands at cmd prompt?

Reply with quote

martin
Site Admin
martin avatar

Re: Capturing Error Code Output

You should better ask on VBA related forum. Maybe this article (<invalid hyperlink removed by admin>) may help.

Reply with quote

Advertisement

You can post new topics in this forum