title: Running batch file from C# Force run from file's directory?
body: <p>So here's my end goal. Steam allows you to add other installed games to your library but only if it's a .exe file it's pointed at to start running.</p>
  
  <p>I just installed Arena and Daggerfall and they both run via DOSBox which is launched from a .bat file. So I decided to turn it into a .exe by writing my own. So far I've got the code written. When I just run the .bat file, it opens everything fine, however, when I try running it from my code, the .bat file executes but with errors. Here is my code below:</p>
  
  <pre><code>        if (File.Exists("D:\\Bethesda Softworks\\Arena\\Arena (Full Screen).bat"))
          {
              System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("cmd.exe", "/c" + "\"D:\\Bethesda Softworks\\Arena\\Arena (Full Screen).bat\"");
              psi.RedirectStandardOutput = true;
              psi.UseShellExecute = false;
  
              System.Diagnostics.Process proc;
              proc = System.Diagnostics.Process.Start(psi);
          }
  </code></pre>
  
  <p>And the error I'm getting is this:
   "The system cannot find the path specified. 'dosbox.exe' is not recognized as an internal or external command, operable program or batch file.</p>
  
  <p>I'm not sure if this is an issue because of how dosbox is called from the Batch file or how the .exe ends up running the batch file. Either way, I'd rather fix this in the code rather than by making alterations to the .bat file itself.</p>
  
  <p>Any help is greatly appreciated!!</p>