I assume you mean get your program to invoke the 'shutdown' command.
This is the most organised and cleanest way of rebooting the system. Users have a chance to save their work and programs can exit cleanly by properly closing files.
The shutdown command can send a message explaining why, and also provide a delay to allow people to react accordingly.
See also InitiateSystemShutdown() and/or ExitWindowsEx() Win API (and related OpenProcessToken(), LookupPrivilegeValue(), AdjustTokenPrivileges() etc) in MSDN. There are some programmatic shutdown codes examples in C. Your application must have corresponding privileges (to adjust privileges...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.