Topic "Capturing Error Code Output"

Author Message
victorme
[View user's profile]

Joined: 2010-03-17
Posts: 5
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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
It looks like you are using .Net, right? Read documentation then.
_________________
Martin Prikryl
victorme
[View user's profile]

Joined: 2010-03-17
Posts: 5
prikryl 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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
You should better ask on VBA related forum. Maybe this article may help.
_________________
Martin Prikryl
victorme
[View user's profile]

Joined: 2010-03-17
Posts: 5
This sets pass fail based on when the shell closes, that doesn't always guarantee file was sent. Thanks for trying though.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License