Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On Windows 8 if you press Alt+F4 with the desktop in focus, it displays a shutdown dialog. I was wondering if anyone knows of a way that this same dialog can be launched from the command line as I would like to remap the "ThinkVantage" button on my ThinkPad to display this message.

Does anyone know if this is possible? Using Task Manager I can see that the dialog is produced from explorer.exe but I have no idea how to execute it manually.

share|improve this question
Open a command prompt, type "shutdown /i" no quotes and hit enter key, not quite the same gui but will perform the same function. – Moab Oct 16 '12 at 21:20
If its just about remapping the key you can use Autohotkey for that, alternatively there are also Registry hack to remap keys. MOre here. – Ankit Mishra Oct 19 '12 at 19:56
Typically the system power button does this. It shouldn't be necessary to assign a second button. Is it not working on your system? – Michael Hampton Oct 20 '12 at 14:36

See this web page:

Open notepad and type the following:

(new ActiveXObject(“Shell.Application”)).ShutdownWindows();

Save this file with any name you like but provide it the .js format as mandatory for example Shutdown.js and pick All files as save as type. Save it to any location but create its shortcut to Desktop.

From there it appears you can launch it how you like, they create place it in a quick launcher folder. So I'd imagine you can invoke it from the command line.

You can also use shutdown /i which is a bit simpler, but doesn't show the same dialog box.

share|improve this answer

The command to initiate the system shutdown is...


with these parameters, you whutdown immediately:

shutdown -s -t 00

with these parameters, the pc will reboot:

shutdown -r -t 00

There are a lot of other parameters, you can check them out here:


shutdown -i

will show another dialog (really ugly, actually)

share|improve this answer

I wanted to map this dialogue to a shortcut key myself and although there were good alternatives, the question wasn't answered to the question. I searched and fiddled around and came up with a script.

You can use AutoHotKey to let any key (Ctrl + Alt + 1 in this case) summon the dialogue with this script:

;Summon the Shutdown, Restart Windows dialogue by pressing Ctrl + Shift + 1
^!1::ControlSend, , !{F4}, ahk_class Progman

Which actually presses Alt + F4 while targeting the Windows Desktop.

Short instructions:

  • Download and install AutoHotKey;
  • Open notepad;
  • Paste the above code and save the file as {anyfilename}.ahk;
  • In windows explorer, right+click on the file and choose Compile;
  • Start the resulting {anyfilename}.exe


  • You can put a shortcut to the exe in your Startmenu/Startup folder so it will start everytime when windows starts.

You can find a list and examples of Hotkeys @

You can find special keys with the AutoHotKey script @ For some special keys you need to put #InstallKeybdHook in your script.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .