title: Java - apache commons exec, run 2 commands in same "context"
body: <p>I am unsure if context is the right word to use here but what i mean is something like  </p>
  
  <pre><code>cd .\test
  test.exe
  </code></pre>
  
  <p>test.exe is located in the folder test and I want to run it from the folder test, I know I can run</p>
  
  <pre><code>.\test\test.exe
  </code></pre>
  
  <p>but I need test.exe to be run from the folder test.</p>
  
  <p>Is there a way to run both commands in the same "context"?</p>
  
  <p>I have tried:</p>
  
  <pre><code>String cmd1 = "cmd /C cd test";
  String cmd2 = "test.exe";
  CommandLine cmdl1 = CommandLine.parse(cmd1);
  CommandLine cmdl2 = CommandLine.parse(cmd2);
  DefaultExecutor exec = new DefaultExecutor();
  exec.execute(cmdl1);
  exec.execute(cmdl2);
  </code></pre>
  
  <p>but as expected it could not find <code>test.exe</code>.</p>