Windows – Command to Call ‘Turn Off Computer’ Menu

command linewindows xp

I remember there is (or was) a command involving rundll32 that calls Windows XP's 'Turn Off Computer' menu – the one that can also be invoked by going to Start Menu > Turn Off Computer.

enter image description here

Does anyone happen to know/remember what the command is?

P.S.: I'm not talking about the 'shutdown' command.

Final edit: Well, the closest command to get this result with rundll32 is the following:

rundll32 msgina.dll,ShellShutdownDialog

But note that you'll get the 'classic' menu/dialog instead of the modern, 'themed' version.
You can get the latter using a VBScript one-liner posted by techie007 below.

Best Answer

As others have rightfully pointed out, those commands don't work and/or shouldn't be used.

Here's an option, you can use scripting to call that shutdown dialog/menu (it just pops up the shutdown menu; it doesn't select any action). Here's a couple basics to get you started:

VBS:

CreateObject("Shell.Application").ShutdownWindows

Save as Something.vbs and run it with cscript Something.vbs.

PowerShell:

(New-Object -ComObject Shell.Application).ShutdownWindows();

You can get PowerShell 2.0 for XP (etc.) from MS here (KB968930).

These should work on all versions of XP and up (the VBS may work on Windows 2000 as well). I tested them on Windows 7 (Ultimate) and they worked.

Related Question