Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cannot execute Windows commands via Python in 64-bit


  • From: timr at probo.com (Tim Roberts)
  • Subject: Cannot execute Windows commands via Python in 64-bit
  • Date: Sat, 05 May 2007 22:40:21 GMT

minitotoro <nsjmetzger at gmail.com> wrote:
>
>Upon further investigation it turned out to be a windohs 64-bit issue
>(which is what I was afraid of). I did however find an asinine work
>around.
>
>Make a copy of defrag.exe from the system32 folder and paste it in the
>same directory as the python script. Voila! It now works. Piece of
>junk windohs... :-S

If you are using a 32-bit Python, then all references you make to
\windows\system32 are automatically rewritten to \windows\syswow64.  If
defrag.exe is not present in \windows\syswow64, that could explain it.

Unbelievable but true.  Although we were all smart enough to handle the
transition from \windows\system in Win16 to \windows\system32 in Win32,
Microsoft apparently believes programmers have all grown too stupid to
handle the transition to Win64 on our own.

Some registry references are also silently rewritten.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.