Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

victorme

This sets pass fail based on when the shell closes, that doesn't always guarantee file was sent. Thanks for trying though.
martin

Re: Capturing Error Code Output

You should better ask on VBA related forum. Maybe this article (<invalid hyperlink removed by admin>) may help.
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?
martin

Re: Capturing Error Code Output

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

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.