title: system("c:\\sample\\startAll.bat") cannot run because of working directory?
body: <p>I have an application and executables. I want my application to run my executables.</p>
  
  <p>The executable files are in a folder, lets say in "c:\sample".</p>
  
  <p>In this directory there is a batch file that calls my exe's. like:</p>
  
  <pre><code>start a1.exe
  start a2.exe
  start a3.exe
  </code></pre>
  
  <p>let's name it as startAll.bat</p>
  
  <p>and suppose every exe has a data like a1.dat a2.dat ... and these data files are near this exe's.</p>
  
  <p>I want to call this batch file by my application.</p>
  
  <pre><code>system("c:\\\\sample\\\\startAll.bat");
  </code></pre>
  
  <p>when I call it like that, command cannot find these exe's. </p>
  
  <p>if I add directory names to batch files, it can not find the data that time.
  I think it is because of working directory.</p>
  
  <pre><code>start c:\sample\a3.exe
  </code></pre>
  
  <p>how can I change the working directory before I call this batch file?</p>
  
  <p>or do you suggest anything else?</p>