Question

This is the file I'm searching for on a Windows XP computer

C:\Windows\System32\winlogon.exe

I have displayed file extensions for all files, checked Show Hidden Files, checked Show Hidden System Files, and I can see the file using Explorer but cannot see the file with python. I cannot even see the file using:

os.system( 'dir C:/Windows/System32/winlogon.exe' )

I can see the file by using command prompt by running

dir C:\Windows\System32\winlogon.exe

Python's documentation: "On some platforms, this function may return False if permission is not granted to execute os.stat() on the requested file, even if the path physically exists."

I'd like to use the regular python libraries to be able to do this. I also tried open() command. How do I go about finding this file using Python?

Note: I'm running Python27 under Cygwin in Windows XP. This is because I'm in networking and it's easier to write scripts that run off of Linux, ssh into Windows' Cygwin sshd client, in order to run things.

Was it helpful?

Solution

The issue was that I was using 64 bit Windows with 32 bit Cygwin. Apparently 32 bit Cygwin can only see 32 bit files while 64 bit Cygwin can see all the files.

Source: http://cygwin.com/ml/cygwin/2006-01/msg00444.html

This may be true for all 32 bit applications running on a 64 bit environment. Another reason for many 32 bit applications to upgrade to 64 bit if the applications plan to be run on present 64 bit machines.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top