B
Brett Romero
I'd like to execute a batch file. However, I just get a quick DOS
window flash when I run this code:
System.Diagnostics.ProcessStartInfo p = new
System.Diagnostics.ProcessStartInfo
(@"C:\mybat.bat");
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = p;
proc.Start();
proc.WaitForExit();
If I double click the bat file, I see the DOS window with output and
everything executes. If I open a DOS window and type in the bat file,
everything works fine again. The file modifies other files. Looking
at the files that are supposed to be modified, I can see it isn't
executing via the C# code.
Any ideas?
Thanks,
Brett
window flash when I run this code:
System.Diagnostics.ProcessStartInfo p = new
System.Diagnostics.ProcessStartInfo
(@"C:\mybat.bat");
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = p;
proc.Start();
proc.WaitForExit();
If I double click the bat file, I see the DOS window with output and
everything executes. If I open a DOS window and type in the bat file,
everything works fine again. The file modifies other files. Looking
at the files that are supposed to be modified, I can see it isn't
executing via the C# code.
Any ideas?
Thanks,
Brett