title: How to set the working directory of a command in a Windows batch file?
body: <p>Let's say I have these commands:</p>
  
  <pre><code>Prog1.exe
  D:\SomeDir\Prog2.exe
  Prog3.exe
  </code></pre>
  
  <p>Now, say for the second line, I would like the working directory to be D:\SomeDir, but in Prog1.exe and Prog3.exe I want the default working directory (normally, where my .bat file is). If I try this</p>
  
  <pre><code>Prog1.exe
  cd D:\SomeDir
  D:\SomeDir\Prog2.exe
  Prog3.exe
  </code></pre>
  
  <p>Apparently Prog3 will be executed in SomeDir, which is not what I want.</p>