Reboot the computer.

  • Thread starter Thread starter UJ
  • Start date Start date
U

UJ

How can I programmatically reboot the machine? I don't want to just shut it
down, I want to actually reboot it.

TIA - Jeff.
 
From PInvoke.net:

class Class1
{
[DllImport("user32.dll")]
static extern bool ExitWindowsEx(ExitWindows uFlags,
ShutdownReason dwReason);

[STAThread]
static void Main(string[] args)
{
ExitWindowsEx(ExitWindows.Reboot, ShutdownReason.MajorOther
& ShutdownReason.MinorOther);
}
}
 

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

Back
Top