Reputation: 13
I need to (force) reboot Windows from inside a Windows Service written in C#. The ordinary way of doing it, from a desktop application, shutdown.exe, will probably not work at all? I assume I cannot run an EXE file from inside a service..
Upvotes: 0
Views: 592
Reputation: 21
I have tested it, but it does not work inside a Windows Service, it seems..
Upvotes: 0
Reputation: 597051
Look at the Win32 API InitiateSystemShutdown()
and/or InitiateSystemShutdownEx()
function.
Also refer to this MSDN article: Shutting Down.
Upvotes: 1