Advertisement
Guest User

Untitled

a guest
Apr 16th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. ProcessStartInfo startInfo = new ProcessStartInfo("shutdown /r /f /t 5");
  2. startInfo.UserName ="user with enough rights";
  3. startInfo.Password ="password";
  4. Process.Start(startInfo);
  5.  
  6. // /r - restart
  7. // /f - force
  8. // /t 5 - wait 5 seconds
  9.  
  10. System.Diagnostics.Process.Start("shutdown.exe", "-r -t 0");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement