How can o run a commanline app in C #

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

when i run this code i get an error message cant find the specified file, But
if i paste the command into the command prompt it works fine could someone
tell me why this is happening
i uses a break point and quick watch to get the command string.
System.Diagnostics.Process Proc = new
System.Diagnostics.Process();
rnGzip = rnGzip + " " + DataPath;
Proc.StartInfo.FileName rnGzip;
Proc.Start( );
Proc.Dispose();
_____________________________________________
 
It looks like you are trying to pass the command with the parameters in the
same string. Instead of setting the StartInfo, you could just call:
Proc.Start(rnGZip, Datapath);
 
Back
Top