title: 7zip cannot open output file on some files (PHP, Command Line)
body: <p>I tried to extract the contents of a zip file in a script I am running with 7zip</p>
  
  <pre><code>&lt;?
      $test_zip = $file_directory;
      $cmd = "FOR /R \"$test_zip\" %I IN (*.zip) DO (7z x \"%I\" -aou -o\"%~dpI\" &amp;&amp; del \"%~fI\")";
      exec($cmd, $out, $ret);
  </code></pre>
  
  <p>(hundreds and hundreds of files of different types) and it failed. I've used 7zip successfully for other similar zip files so I figured I would try it again and it still failed.</p>
  
  <p>So I tried it again via Command Prompt so I could check the Exit Codes. The results were that it failed, returned a 0 (No Error) for Exit Codes, and I also saw that for <strong><em>some</em></strong> of the files I received this error: "can not open output file {file name here}". It seemed to be a variety of file types that had this problem and yet the majority of the files in the zip were extracted fine. </p>
  
  <p>If <strong><em>all</em></strong> the files had this problem I would just figure it was a permissions issue, but I do not know what could make only <strong><em>some</em></strong> of the files have this problem. Any insight would be greatly appreciated. Thanks!</p>