Post a reply

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

daforga

Having trouble running from .net application

I have been using a .bat to run WinScp to download from a ftp site which works fine. The line in the .bat file is : winscp.exe /script=FMCSADownLoad.txt
FMCSADownLoad.txt reads:
open riviera@fileserv.fmcsa.dot.gov
get *.txt
exit

A new requirement is that I put this process into the body of my .net application.

I have tried:

Process winscp = new Process();
winscp.StartInfo.FileName = "C:\\FMCSA_Upload\\winscp.com";
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.CreateNoWindow = true;
winscp.StartInfo.RedirectStandardInput = true;
winscp.Start();
winscp.StandardInput.WriteLine("open riviera@fileserv.fmcsa.dot.gov");
winscp.StandardInput.WriteLine("get *.txt");
winscp.StandardInput.WriteLine("exit");

This does not work. Can anyone guide me to a way to run an existing session from a .net application?

Thanks
Dave