Reboot Windows XP using Python's win32api

Benjamin Binford bbin__ at hotmail.com
Fri Feb 7 09:06:30 EST 2003


On Fri, 07 Feb 2003 10:23:02 +0100, Lukas Kubin wrote:

> Does anybody have an experience doing Windows XP reboot from within the
> Python's script using win32all modules? I'm trying to use the function
> initiateSystemShutdown() but am getting "Access denied" response. But I
> ame trying it being logged in as Administrator. Should I do something
> more with the privileges?
> Thank you.


You need to grant yourself the SE_SHUTDOWN_NAME privilege before windows
will let you initiate shutdown. I haven't done any python win32
programming (only on unix), but I've done this before in C and it's pretty
easy. Microsoft has sample code in C at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/displaying_the_shutdown_dialog_box.asp




More information about the Python-list mailing list