title: Why cannot run an executable file with exec() or system() functions?
body: <p>I'm trying to run <code>notepad</code> on the server (<code>localhost</code> for now). </p>
  
  <p><code>exec()</code> and <code>system()</code> functions are working fine when for example write <code>ping 127.0.0.1</code>.</p>
  
  <p>But this does not work (working fine if I write the command directly in the command prompt): </p>
  
  <pre><code>$command = "C:\WINDOWS\system32\notepad.exe";
  
  $result = system($command);
  
  print_r($result);
  </code></pre>
  
  <p>Using <code>Windows XP</code> with <code>xampp</code>. Probably I don't have permissions because the command is executed from some other account but I don't know how to check this.</p>
  
  <p>Any advices?</p>
  
  <p><strong>Edit:</strong> </p>
  
  <p>As <a href="https://stackoverflow.com/a/16037080/1333512"><code>bwoebi</code></a> said, I have opened processes but they are opened from a different user (SYSTEM) and I can't see when the application is opened. So, I have to paraphrase my question: how to change the user which is used when executing commands from a PHP script? </p>