Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
3  
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
1  
If its just about remapping the key you can use Autohotkey for that, alternatively there are also Registry hack to remap keys. MOre here. –  Lamb Oct 19 '12 at 19:56
1  
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
add comment

2 Answers 2

See this web page:

http://www.thewindowsclub.com/windows-shut-down-dialog-box


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
add comment

The command to initiate the system shutdown is...

shutdown

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: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/shutdown.mspx?mfr=true

typing

shutdown -i

will show another dialog (really ugly, actually)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.