Problem remotely shutting down a windows computer with python
Kartic
kartic.krishnamurthy at gmail.com
Sun Jan 2 23:50:10 EST 2005
Hi,
According to the online docs for InitiateSystemShutdown() at
http://aspn.activestate.com/ASPN/docs/ActivePython/2.2/PyWin32/win32api__InitiateSystemShutdown_meth.html
bRebootAfterShutdown : int
Specifies whether the computer is to restart immediately after
shutting down. If this parameter is TRUE, the computer is to restart.
If this parameter is FALSE, the system flushes all caches to disk,
clears the screen, and displays a message indicating that it is safe to
power down.
Same at Microsoft for the Win32 API Call -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/initiatesystemshutdown.asp
Looks like this is the documented outcome. You could alternatively try
setting a little XML-RPC app to invoke 'shutdown -s' on the remote PC
from your PC (e.g. using Twisted Python).
Thanks,
--Kartic
More information about the Python-list
mailing list