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,578
  • 4
  • 51
  • 64
will
  • 312
  • 3
  • 9

1 Answers1

0

Use shutdown.exe of Windows.

using System.Diagnostics;

Process.Start("shutdown","-s -t 10");
default
  • 11,485
  • 9
  • 66
  • 102
Praveen Nambiar
  • 4,852
  • 1
  • 22
  • 31