[try Beta version]
Not logged in

 
How do I make a button in Windows Form shutdown my computer?

Jan 16, 2017 at 5:51pm
How do I make a button in Windows Form shutdown my computer? I it searched up and couldn't find anything for 7 tries.
Jan 16, 2017 at 8:31pm
Never tried but on stackoverflow I saw this tip.
 
   System::Diagnostics::Process::Start("shutdown","/s /t 0"); // translated to C++/CLI 


http://stackoverflow.com/questions/102567/how-to-shut-down-the-computer-from-c-sharp
Jan 16, 2017 at 9:13pm
Thanks! It worked. It took some time figuring out where to put the code and all.
Jan 17, 2017 at 6:25pm
Even shorter:
system("shutdown /s");
Topic archived. No new replies allowed.