How to: issue a shutdown/restart?

  • Thread starter Thread starter Rob R. Ainscough
  • Start date Start date
R

Rob R. Ainscough

Any hints on how have a .NET app issue a shutdown/restart?

Thanks Rob.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top