I have a requirement to trigger a reboot on a windows7 machine programmatically. This is to support a scenario for customers where when they log out of an intenet kiosk machine the machine reboots. On XP this was achieved using WTSSystemShutdown but Im wondering if theres another way. Any pointers greatly appreciated.
+4
A:
You can call ExitWindowsEx to restart, shutdown, logoff, etc.
Use InitiateShutdown (Vista) or InitiateSystemShutdownEx (Win2k or higher) to shutdown a computer remotely.
Gabe
2010-03-18 03:12:46
A:
I answered a similar question here (complete with sample code):
Log off user from Win XP programmatically in C# (ExitWindowsEx)
Just change the uFlags
parameter to ExitWindows.Reboot
.
Kev
2010-03-18 03:14:14