I am trying to run a batch script from within a c sharp program the code I am using is shown below:
Process proc = new Process();
proc.StartInfo.FileName = "G:\\Media\\Downloads\\print.bat";
proc.Start();
The script is simple (for testing purposes) and contains one line:
echo hello > output.txt
When I run the script from windows explorer it works, but does not when run from the C# code.
any thoughts?
Also how can I give the processes a callback method for when it has finished?
Thanks