title: Spawn Process from a C# Windows Service
body: <p>Well, Im trying to spawn a process from inside a thread spawned by a Windows Service. The goal being to read the output and printing to the window in focus -- where cursor is. Probably a bad idea, I don't know i'm not a c# programmer</p>
  
  <p>Anywho spawning the process works when I call the function itself, but not when it's called inside a running service. Is starting a process inside a service possible?</p>
  
  <pre><code>Process proc = new Process();
                  proc.StartInfo.FileName = @"C:\file.bat";
                  proc.StartInfo.RedirectStandardError = true;
                  proc.StartInfo.RedirectStandardOutput = true;
                  proc.StartInfo.UseShellExecute = false;
  
                  proc.Start();
  
                  String outputMessage = proc.StandardOutput.ReadToEnd();
                  proc.WaitForExit();
  </code></pre>