Search code examples
c#windows-8system-shutdown

Show shutdown dialog box from c#


Is there a way to display the Windows shutdown dialog box from c#?

Shutdown dialog box

I found a command that I can use with System.Diagnostic.Process.Start

taskkill /im explorer.exe

But doesnt works on Windows 8


Solution

  • You could use shutdown.exe instead of trying to kill explorer.:

    shutdown.exe /i /t 0