Reboot windows when nobody logged in

Alex K. Angelopoulos aka at
Thu Feb 13 23:17:45 CET 2003

In addition to your comments, Lukas -

I've successfully implemented code which reboots XP using the ExitWindowsEx
function after performing token adjustment.  Based on your description, I would
try testing it while logged on interactively.


This will tell us whether the problem is technical details of method you are
using to call it (in which case it will fail there), or related to
environment/privileges of the account running it when no one is logged on.

By the way, if it makes a difference, you don't need any of this with 2000/XP to
perform a remote reboot.  You can use WMI, which is accessible to Python, and
call the Reboot Method in class Win32_OperatingSystem.

Depending on your situation, this might be a feasible solution.


"Lukas Kubin" <kubin at> wrote in message
news:Pine.LNX.4.44.0302130829010.14458-100000 at
> Hash: SHA1
> I don't have the book but I've tried the script from the
> examples archive. It didn't work for me. Could you tell me, please, how
> did you implement the reboot code to work while waiting for login? How did
> you let it know you wish to reboot?
> Thank you.
> lukas
> On Wed, 12 Feb 2003, dsavitsk wrote:
> > "Lukas Kubin" <kubin at> wrote in message
> > news:Pine.LNX.4.44.0302121331021.31917-100000 at
> > > I need to code a program rebooting windows xp, when nobody is logged on.
> > > It means the computer is in the state with login window on. I have a
> > > simple windows service waiting for a tcp connection which should cause the
> > > reboot. I use the Python's win32api function ExitWindowsEx() but nothing
> > > happens.  When I test the reboot when anybody is logged on, it works. (Yes
> > > I've done all the AdjustPrivilege etc. already).
> > > Does anybody have experience doing such code?
> >
> > There is an example of how to reboot a remote computer which is included (i
> > think) in both win32all and Mark's book.  It works on a computer at the
> > login screen in win2k, but I can't speak to XP.
> >
> > -d
> >
> >
> >
> - -- 
> Lukas Kubin
> phone: +420696398285
> email: kubin at
> Information centre
> The School of Business Administration in Karvina
> Silesian University in Opava
> Czech Republic
> Version: GnuPG v1.2.0 (GNU/Linux)
> Comment: Made with pgp4pine 1.75-6
> iD8DBQE+S0oMhukdIiZrwu4RAg26AJkBkLg4XPNIoaAcNgk1luvAbgg80ACcCxKn
> k1YlBFrVmJbVy5ufqEP/8Rw=
> =71vC

More information about the Python-list mailing list