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 referecned by my batch file, and the error.txt is the file I want the code 0 or 1 output to.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,209
Location:
Prague, Czechia

Re: Capturing Error Code Output

It looks like you are using .Net, right? Read documentation then.
_________________
Martin Prikryl

Reply with quote

victorme
Joined:
Posts:
5

Re: Capturing Error Code Output

martin wrote:

It looks like you are using .Net, right? Read documentation then.

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
Joined:
Posts:
27,209
Location:
Prague, Czechia

Re: Capturing Error Code Output

You should better ask on VBA related forum. Maybe this article may help.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum