rebooting from service with no login

  • Thread starter Thread starter Lauren Hines
  • Start date Start date
L

Lauren Hines

I am trying to create a service that will (among other things) reboot the
embedded xp device even if no one is logged into the system (ie. the logon
screen is currently displayed).

In my service (written in C# .NET) I have tried using the different APIs
(and variants of) InitiateSystemShutdownEx and Win32Shutdown. The return
error is always 21 ("The device is not ready"). The service works fine if
anyone is logged in, so I do not believe it is a permissions problem. I have
also tried using "shutdown.exe" to no avail.

Any help would be greatly appreciated. Thanks in advance.
 
Lauren,

If your service is standard service started by SCM with system credential
then you ca use.
Functions from xpepm.dll or API call NtShutDownSystem.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=NtShutDownSyst
em&meta=group%3Dmicrosoft.public.windowsxp.embedded.*

Regards,
Slobodan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have an opinion on the effectiveness of Microsoft Embedded newsgroups? Tell
Microsoft!
https://www.windowsembeddedeval.com/community/newsgroups
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Lauren:

How about the ExitWindowsEx API using the EWX_REBOOT parameter. The
calling process must have the SE_SHUTDOWN_NAME privilege. I have done this
in a service written in C++ but not when nobody is logged in.

HTH... Doug
 
Thanks so much - that worked great!!!!

Slobodan Brcin (eMVP) said:
Lauren,

If your service is standard service started by SCM with system credential
then you ca use.
Functions from xpepm.dll or API call NtShutDownSystem.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=NtShutDownSyst
em&meta=group%3Dmicrosoft.public.windowsxp.embedded.*

Regards,
Slobodan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Have an opinion on the effectiveness of Microsoft Embedded newsgroups? Tell
Microsoft!
https://www.windowsembeddedeval.com/community/newsgroups
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top