Windows7 run python script / sub process with elevated privileges

Tim Golden mail at timgolden.me.uk
Thu May 6 05:11:22 EDT 2010


On 01/05/2010 15:44, News123 wrote:
> Hi,
>
> I have a small python script, which has been started as normal non
> privileged user.
>
> At a later point in time it would like to start another python script
> with elevated privileges.
>
> How can I write my code such, that I will get the privilege elevation
> prompt and I can start a sub process / python function with elevated
> privileges.

The canonical way is to use the "runas" verb from within
ShellExecuteEx, which is exposed by the win32api module.

TJG



More information about the Python-list mailing list