title: How to call an exe from a Web Service in C#
body: <p>Here is the problem, we need to print some document from a mainframe terminal, but we can only call web services from mainframe. We have a .exe applications the we want the Web Service to call it and pass the respective parameters. When we executed the .exe it works perfectly but when we call it from within the web service nothing happens.</p>
  
  <p>This is a sample code to call the exe:</p>
  
  <pre><code>System.Diagnostics.ProcessStartInfo startInfo;
  startInfo = new System.Diagnostics.ProcessStartInfo(@"C:\Inetpub\wwwroot\PrintBarCode.exe");
  startInfo.UseShellExecute = false;
  startInfo.CreateNoWindow = false;
  startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
  
  using (System.Diagnostics.Process exeProcess = System.Diagnostics.Process.Start(startInfo))
  {
      exeProcess.WaitForExit();
  }
  </code></pre>