Python 2.7 and cmd on Windows 7 64 (files lost)

Thorsten Kampe thorsten at thorstenkampe.de
Thu Jun 23 03:31:16 EDT 2011


* Michel Claveau - MVP (Thu, 23 Jun 2011 08:33:20 +0200)
> On Win 7 64 bits:
>   Command-Line
>   CD \Python27
>   dir C:\Windows\System32\SoundRecorder.exe    :==> OK
>   Python.exe
> 
> >>> import os
> >>> os.system("dir C:\\Windows\\System32\\SoundRecorder.exe")  
> 
> ==> Do not found the file !!!
> 
> and os.system("cmd /k")  then  "dir C:\Windows\System32\SoundRecorder.exe"  do not found
> anyway.

This is because 32-bit processes (Python, 32-bit cmd) cannot see the 64-
bit DLLs in System32.
 
> But:
>   {Ctrl-Z} in Python
>   then  dir C:\Windows\System32\SoundRecorder.exe  run OK

Now you are running 64-bit Cmd.
 
> Therefore, is the problem only in Python? 

Of course not (see above).

Thorsten



More information about the Python-list mailing list