Reboot windows when nobody logged in
kubin at opf.slu.cz
Fri Feb 14 08:45:23 CET 2003
-----BEGIN PGP SIGNED MESSAGE-----
Thank you for your reply.
My code works fine when anybody is logged on. But it doesn't when there's
the login window of Novell. Then I send the signal, nothing happens; I log
in or just (!) press Esc and it reboots.
I know almost nothing about Windows programming. So WMI says nothing to
me. Could you please let me know more about it? How to call that
reboot method? Do you mean I should not use ExitWindowsEx() ?
On Thu, 13 Feb 2003, Alex K. Angelopoulos wrote:
> 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 opf.slu.cz> wrote in message
> news:Pine.LNX.4.44.0302130829010.14458-100000 at x.opf.slu.cz...
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > I don't have the book but I've tried the RebootServer.py 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 opf.slu.cz> wrote in message
> > > news:Pine.LNX.4.44.0302121331021.31917-100000 at x.opf.slu.cz...
> > > > 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 opf.slu.cz
> > Information centre
> > The School of Business Administration in Karvina
> > Silesian University in Opava
> > Czech Republic
> > http://www.opf.slu.cz
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.2.0 (GNU/Linux)
> > Comment: Made with pgp4pine 1.75-6
> > iD8DBQE+S0oMhukdIiZrwu4RAg26AJkBkLg4XPNIoaAcNgk1luvAbgg80ACcCxKn
> > k1YlBFrVmJbVy5ufqEP/8Rw=
> > =71vC
> > -----END PGP SIGNATURE-----
email: kubin at opf.slu.cz
The School of Business Administration in Karvina
Silesian University in Opava
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6
-----END PGP SIGNATURE-----
More information about the Python-list