[Tutor] Communicating with Win2000 runas.exe

Barnaby Scott bds at waywood.co.uk
Thu Aug 17 14:52:56 CEST 2006


I have a problem which I was hoping that Python could solve for me, but
I have become stuck for days now after only 2 lines of code.

My son has a Microsoft game on a shared family computer, which Microsoft
in its infinite wisdom requires you to run as 'administrator'. Call me
old-fashioned but I don't want to promote an 8 year-old to administrator
just so he can run his game!

Enter 'runas.exe'...

However, because we are on Windows 2000, runas does not allow you to
save a password - it has to be entered every time: not much further forward.

So I'm thinking along these lines:

import subprocess
sp = subprocess.Popen(r'C:\WINNT\SYSTEM32\runas.exe /user:administrator
C:\Program Files\Microsoft Games\Age of Mythology\aom.exe')
#some sort of code to send the password here...
#help!

Sure enough, this brings up a prompt asking for the administrator's
password, but I can't get anything to work in terms of getting the 
script to provide the password.

Am I barking up the wrong tree here? Any clues would be gratefully
received. (Even if I do get this to work, my next trick is to hide the
password from any prying eyes looking at the script...)

Thanks

Barnaby Scott




More information about the Tutor mailing list