challenging problem for changing to a dedicated non-privileged user within a script.

Martin P. Hellwig martin.hellwig at dcuktec.org
Wed Jul 22 20:22:14 EDT 2009


Krishnakant wrote:
<cut elevate/dropdown rights problem>

I've seen a method before in a MS cmd script (MakeMeAdmin.cmd) for the 
purpose of temporarily elevating your rights but remaining the same user.

There was a need trick in that the script checks itself on what 
credentials it runs, if it is not the appropriate one it will call 
itself again with runas (about the same as sudo) and exits.

If it has the right credentials it will perform the actual task.

That might be a way to solve your problem.

-- 
MPH
http://blog.dcuktec.com
'If consumed, best digested with added seasoning to own preference.'



More information about the Python-list mailing list