Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when trying to run a file 1

Status
Not open for further replies.

Craftor

Programmer
Feb 1, 2001
420
NZ
Hi all

I am trying to launch a file - as follows:

Code:
Process proc = new Process();
proc.StartInfo.RedirectStandardError=true;
proc.StartInfo.RedirectStandardInput=false;
proc.StartInfo.RedirectStandardOutput=false;
proc.StartInfo.CreateNoWindow=true;
proc.StartInfo.ErrorDialog=false;
proc.StartInfo.UseShellExecute=false;
proc.StartInfo.FileName = @"C:\FTPFeed\ftpFeedGen /Url:[URL unfurl="true"]http://testmachine/webpath/engine.asmx/getFile?CompanyKey=DemoTest[/URL] /File:file03022004_051011.xml /User: FTP /pwd: password";
proc.Start();

but it is giving me the following error:
The filename, directory name, or volume label syntax is incorrect.

If I copy and paste my file into a command window - it runs fine.

Can anyone help me with this, please?

Thanks as always

Craftor
:cool:
 
I think what you want is:

Code:
proc.StartInfo.FileName = @"C:\ftpFeed\ftpFeedGen";
proc.StartInfo.Arguments = "/Url:[URL unfurl="true"]http://testmachine/webpath/engine.asmx/getFile?CompanyKey=DemoTest[/URL] /File:file03022004_051011.xml /User: ftp /pwd: password";
 
Thanks so much rosenk - that is exactly what I was looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top