IIS problem with Drupal - Update manager: Update failed! Directories are locked by php-cgi.exe I have some problem when using the "Update manager" on the GUI. Some directories get locked by php-cgi.exe, and thus the replacement of the original directories with the newly downloaded ones (which are fresher) is not successful.
BUT I have to mention that it's not a permission issue, because the modules can get installed via "Install from a URL" on /admin/modules/install, and work without a problem.

Let's take an example:


Available updates page (/admin/reports/updates/update):



Now I check Select (or other) module to be updated (it doesn't matter which module I choose, the results are the same!! so it's just an example).
I hit "Download these updates" button.
OK, the module's updated instance gets downloaded without a problem:
"Updates downloaded successfully":

Now I click on Continue.
Here comes the error. The result:
"Update failed! See the log below for more information.
select_or_other  


Error installing / updating
File Transfer failed, reason: Cannot copy D:/Projects/web/drupal-7/tmp/update-extraction-6d8993ac/select_or_other/LICENSE.txt to /Projects/web/drupal-7/htdocs/sites/all/modules/select_or_other/LICENSE.txt."


OK, I'm starting to try to inspect the possible reasons.  


Here's what my Drupal directory structure looks like: . I set ../tmp to be the temporary directory (in /admin/config/media/file-system), the Drupal files are in htdocs. This is correct, as I can install modules via the GUI, as I mentioned above.  
When I try to enter the htdocs/sites/all/modules/select_or_other directory, I can't, because I get an "Access denied on file ......sites/all/modules/select_or_other!" when opening in Total Commander, and "...sites/all/modules/select_or_other is not accessible. Access is denied" when opening in Windows Explorer:
, 
OK, I right click the folder, and open Unlocker via its assistant in the context menu. It says this directory is locked by php-cgi.exe:

I click on "Unlock All", and the folder can now get deleted of itself (as it's not locked anymore by php-cgi.exe), so it simply 
I can find the updated select_or_other module's directory in tmp:

so I have to manually move it to sites/all/modules directory.



What can be the possible reasons of the lockup of the directory by php-cgi.exe? (Maybe Windows Cache Extension 1.1 for PHP 5.3 installed via Web Platform Installer? But if yes, why is that for example the deletion of images or similar via the GUI works correctly?)
What can I do to avoid this problem, and let "Update manager" work?
The reason for php-cgi for having the Lock is because of the "peculiar" way windows handles file access, and php/iis handles "caching". 
Basically you just created the directory and tried to access it, but the handle that created it was not released (so it was still locked). 
This is not a drupal issue, its an IIS/PHP issue
And there is no known workaround that I could find. 

Basicly, do the base advise of not using IIS is the best, I have seen this problem in more than just drupal with IIS that I solved by moving to apache HTTPD (on win32).
Mind you that was for back at school, with a project where I was required to use windows 2000. 

the best way I know of running drupal on windows is through apache (because of the internal handling of php).