It seems that with Windows XP the file search functions (Windows API functions FindFirstFile, FindFirstFileEx) will lock the directory.
As a result the directory which is searched can't be deleted while the search handle has not been closed (like a file that is actually opened can't be deleted).
It seems also that this behaviour has been changed with newer Windows versions.
My google-fu seems to be not very strong today but I found at least one discussion where this has been observed too (
Google Groups[
^]):
Quote:
..seems that on XP, FindFirstFile locks the directory, while on
Win7 it does not.