title: How to run an exe file using C# in console application
body: <p>I am trying to run an exe file in my console application which is located on a network drive.
  So what needs to happen is the app needs to map the network drive with a drive letter by using this code:</p>
  <pre><code> private static void MapDrive()
      {
          System.Diagnostics.Process process = new System.Diagnostics.Process();
          System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
          startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
          startInfo.FileName = &quot;net.exe&quot;;
          startInfo.Arguments = @&quot;use w: \\&lt;server&gt;\CompanyData\W10 /user:Administrator Password&quot;;
          process.StartInfo = startInfo;
          process.Start();
      }
  </code></pre>
  <p>This works great and the drive letter is mapped.
  Now the problem I am facing is to run the exe file with in this mapped drive.
  I have tried the below but does not seem to work:</p>
  <pre><code> private static void RunSetup()
      {
          System.Diagnostics.Process process = new System.Diagnostics.Process();
          System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
          startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
          startInfo.FileName = &quot;cmd.exe&quot;;
          startInfo.Arguments = @&quot;w:\setup.exe&quot;;
          process.StartInfo = startInfo;
          process.Start();;
      }
  </code></pre>
  <p>Nothing seems to happen in regards to launching the exe file.<br />
  I need to know what I am doing wrong here?</p>
  <p>Thanks</p>