title: Running a batch file in relative path?
body: <p>There is a batch file which I want to run it when I press the button.
  My code works fine when I use absolute (full) path. But using relative path causes to occur an exception.
  This is my code:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      //x64
      System.Diagnostics.Process batchFile_1 = new System.Diagnostics.Process();
      batchFile_1.StartInfo.FileName = @"..\myBatchFiles\BAT1\f1.bat";
      batchFile_1.StartInfo.WorkingDirectory = @".\myBatchFiles\BAT1"; 
      batchFile_1.Start();
  }
  </code></pre>
  
  <p>and the raised exception:</p>
  
  <blockquote>
    <p>The system cannot find the file specified.</p>
  </blockquote>
  
  <p>The directory of the batch file is:</p>
  
  <pre><code>C:\Users\GntS\myProject\bin\x64\Release\myBatchFiles\BAT1\f1.bat
  </code></pre>
  
  <p>The output <code>.exe</code> file is located in:</p>
  
  <pre><code>C:\Users\GntS\myProject\bin\x64\Release
  </code></pre>
  
  <p>I searched and none of the results helped me. What is the correct way to run a batch file in relative path?!</p>