Hello,
How to run exe program from windows service using c#.
This is mycode:
System.Diagnostics.Process.Start(@"E:\PROJECT XL\INI SQLLOADER\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe");
When i run this service not happening. Please tell me whats wrong with my code. Thanks
How to run exe program from windows service using c#
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 14, 2011, 11:12 PM EDT
Use below code:
proc.StartInfo.FileName = ""; proc.StartInfo.RedirectStandardError = true; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.UseShellExecute = false; proc.Start(); errorMessage = proc.StandardError.ReadToEnd(); proc.WaitForExit(); outputMessage = proc.StandardOutput.ReadToEnd(); proc.WaitForExit(); proc.close(); hope this help you. if it doesn't then post the error you are getting with your scenario. Don't forget to mark as answer. Thanks.Vijay YadavRank #1,637 · 943 reputationPosted Mar 14, 2011, 11:13 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Mar 16, 2011, 11:32 AM EDT
Link1 Link2