title: Possible permissions issue when using exec commands in PHP
body: <p>We have a small office intranet, built in PHP (on an apache server - so WAMP), that allows us to create project folders on our file server. This works by copying a set of template folders to a new location using the shell exec xcopy command and the following switches <code>/e /k /i /c</code>.</p>
  
  <p>We (fairly) recently upgraded to a new file server running Windows Server 2008 R2 Standard. Now the xcopy command no longer works from within PHP. However, I know that the xcopy command is correct because it works if I copy and paste it into a command prompt (on the same machine).</p>
  
  <p>I can see no error message but I assume this is some kind of permissions issue related to the PHP 'user', but I don't know exactly what or how to solve it.</p>
  
  <p>The apache server and the file server are two separate machines. If it's relevant, the apache server is a 32bit machine and the file server is a 64bit machine but, as I say, I can invoke the xcopy command from the CLI of the 32bit machine without a problem.</p>
  
  <p>The Apache process user name is SYSTEM (although I can't seem to use the 'whoami' command to check this)</p>
  
  <p>Any pointers would be greatly appreciated.</p>
  
  <p>FWIW, the exec string looks like this...</p>
  
  <pre><code>echo "xcopy \"\\\\path\\to\\folder\\xxxx_Project\\*.*\" \"\\\\path\\to\\folder\\9876_NEWPROJECT\" /e /k /i /c";
  </code></pre>
  
  <p>which (I think) materializes as this...</p>
  
  <pre><code>xcopy "\\path\to\folder\xxxx_Project\*.*" "\\path\to\folder\9876_NEWPROJECT" /e /k /i /c
  </code></pre>
  
  <p>Obviously, the '9876_NEWPROJECT bit is really a variable.</p>