Service hangs up at WaitForExit after calling batch file
问题 I have a service that sometimes calls a batch file. The batch file takes 5-10 seconds to execute: System.Diagnostics.Process proc = new System.Diagnostics.Process(); // Declare New Process proc.StartInfo.FileName = fileName; proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; proc.StartInfo.CreateNoWindow = true; proc.Start(); proc.WaitForExit(); The file does exist and the code works when I run the same code in-console. However when it runs inside the service, it hangs