0

I'm writing a C# application to automate a couple of common server admin tasks, and one of the tasks that I want to automate is shutting down or restarting the server (because a number of other applications have to be stopped in a certain order, and its a pain to do).

What the best way to invoke tasks on a server? What is the SAFE approach to server and service shutdown?

timrau
  • 22,054
  • 4
  • 51
  • 63
will
  • 302
  • 3
  • 9

1 Answers1

0

Use shutdown.exe of Windows.

using System.Diagnostics;

Process.Start("shutdown","-s -t 10");
default
  • 10,975
  • 8
  • 63
  • 100
Praveen Nambiar
  • 4,766
  • 1
  • 20
  • 31