title: WMIC: how to use **process call create** with a specific working directory?
body: <p>The task is to launch a program using <code>wmic process call create "c:\folder\app.exe"</code> and have <code>app.exe</code> access it's own support files in the <code>app.exe home folder tree</code>.</p>
  
  <p>The batch script below illustrates the problem with WMIC silently changing the working directory, so that the support files cannot be found.</p>
  
  <p>This script creates a second batch file called <code>one.bat</code> that simply types a <code>url.txt</code> file from the same folder, to display <code>www.google.com</code> on the console.</p>
  
  <p>When using <code>wmic</code> to create the process, wmic silently changes the working directory so that <code>one.bat</code> is not found and if I specify the full path as <code>d:\abc\one.bat</code> then <code>one.bat</code> will launch but it can't find the file to be typed called <code>url.txt</code> in it's own folder.</p>
  
  <p>If I copy the WMIC.EXE file to the same folder, it fails in the same way.</p>
  
  <pre><code>@echo off
  set "folder=d:\abc"
  cd /d "%folder%"
  
  (
  echo.@echo off
  echo.type url.txt
  echo.pause
  )&gt;one.bat
  
  (
  echo.@echo off
  echo.www.google.com
  )&gt;url.txt
  
  echo this will work to launch the one.bat but the working directory is wrong and the file can't be found
  wmic process call create "%folder%\one.bat"
  pause
  
  echo this will not launch one.bat because it can't be found
  wmic process call create one.bat
  pause
  
  echo this will not launch one.bat as the working directory is changed
  copy "%windir%\system32\wbem\wmic.exe" .
  .\wmic process call create one.bat
  pause
  </code></pre>
  
  <p>Does anyone know of a <code>WMIC</code> switch that will set the working directory for this command?</p>