2

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

user962284
  • 660
  • 1
  • 12
  • 28

2 Answers2

0

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

shutdown.exe /i /t 0
Reed Copsey
  • 539,124
  • 75
  • 1,126
  • 1,354
0

I haven't tried calling it from a C# process, but shutdown /i pulls a GUI on Windows 8 for me. Note that it isn't the same UI though.

Godeke
  • 15,791
  • 4
  • 60
  • 85