I've got a python program which is supposed to clean up a number of directories and one of them is C:\windows\system32\inetsrv\metaback
; however, os.path.exists()
returns False on that directory even though it exists (and I have permissions to access it).
What's interesting also is that the tool windirstat completely misses it as well.
Can anyone think of a reason why this might be and what's another way I could check to see if it exist? I can't even seem to run os.listdir()
on it.
Update: os.path.exists()
works on this directory if the Windows box is 32-bit, but not if it is 64-bit. Also shows up properly in windirstat on a 32-bit box.
Windows x64 security is quite a bit tighter than windows x86; especially under the current release OSes (7, 2008).
Sounds like your script doesn't actually have the permissions it needs to run. Generally speaking MS locked down quite a few directory paths (like c:\inetpub) which require elevated priviledges in order to perform any actions.
There are huge reasons for this and it's generally considered a very good thing.
I believe you'll want to mark your script (or whatever executes it) as "Run as administrator" in order to give it the elevated control. Of course, this may require you to confirm execution via the UAC.
For further information, go to serverfault.com and ask there.