title: 'incorrect function' is returned from exec when calling java
body: <p>I'm calling <code>cmd to excute java</code>, but the <code>resultcode</code> is always 1，after checking, I found it represents 'incorrect function'.
  My code is like:</p>
  
  <pre><code>Exec('cmd', '/c C:\Program Files\jre\bin\java -version','' , SW_HIDE,   ewWaitUntilTerminated, ResultCode);
  </code></pre>
  
  <p>I also call, the following code, it doesn't work either:</p>
  
  <pre><code> Exec('cmd', '/c "C:\Program Files\jre\bin\java -version"','' , SW_HIDE,  ewWaitUntilTerminated, ResultCode);
  </code></pre>
  
  <p>if I call the following code, it works</p>
  
  <pre><code> Exec('cmd', '/c java -version','' , SW_HIDE, ewWaitUntilTerminated, ResultCode);
  </code></pre>
  
  <p><strong>It seems the the space in the java path` can not be recognized</strong>. Does anyone know how to correct it?</p>