Telling the computer to shutdown, restart, standby, and hibernate
-
Ok, well now that i know how to show the desktop, something else i need the program i am making to do is shutdown, restart, hibernate, and most importantly standby the computer. I know there is a shutdown.exe in the windows directory, and i was wondering if that could do it (if it can, i don't know what commands to pass to it). Also, if your really smart, it would be nice if i could know how to shut down the computer and have it restart after x amout of time (i have seen that done with a 50-second interval, and i don't know if it can be done with variable amounts of time).
-
Ok, well now that i know how to show the desktop, something else i need the program i am making to do is shutdown, restart, hibernate, and most importantly standby the computer. I know there is a shutdown.exe in the windows directory, and i was wondering if that could do it (if it can, i don't know what commands to pass to it). Also, if your really smart, it would be nice if i could know how to shut down the computer and have it restart after x amout of time (i have seen that done with a 50-second interval, and i don't know if it can be done with variable amounts of time).
Hi, do you remember those good old days where /? gave help information on DOS commands? It still works for shutdown.exe, so most of your needs have an easy solution based on Process.Start(). The restart-with-delay does not seem to be in the list of options tho. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Voting for dummies? No thanks. X|
-
Ok, well now that i know how to show the desktop, something else i need the program i am making to do is shutdown, restart, hibernate, and most importantly standby the computer. I know there is a shutdown.exe in the windows directory, and i was wondering if that could do it (if it can, i don't know what commands to pass to it). Also, if your really smart, it would be nice if i could know how to shut down the computer and have it restart after x amout of time (i have seen that done with a 50-second interval, and i don't know if it can be done with variable amounts of time).
Article on calling shutdown.exe[^]. Instead of doing that, just make a call to ExitWindowsEx[^].
-
Article on calling shutdown.exe[^]. Instead of doing that, just make a call to ExitWindowsEx[^].
Thanks, and that helps a lot, but neither of those methods have a function to hibernate or put the comp into standby. Is there any way i can do that?
-
Thanks, and that helps a lot, but neither of those methods have a function to hibernate or put the comp into standby. Is there any way i can do that?
SetSuspendState[^] API, or Application.SetSuspendState[^] in .NET.