How to: issue a shutdown/restart?

  • Thread starter Thread starter Rob R. Ainscough
  • Start date Start date
Rob R. Ainscough said:
Any hints on how have a .NET app issue a shutdown/restart?

If you mean an application shutdown and restart, then
Application.Restart() can do the job.

If you mean shutdown or restart the machine, I'm sure there's a way to
do it through System.Management, but a more direct route is the
InitiateSystemShutdown/Ex, called via P/Invoke - http://pinvoke.net has
the right declaration.

-- Barry
 
Back
Top