Unhandled Perception
From the mind of a developer.

Monday, October 24, 2005

Shut down Windows through a shortcut

There are many ways you can create a shortcut on your desktop (or the desktop of a remote system) to shutdown or restart Windows.

Below are a few of the ways I have come across.

1. Shutdown.exe:

Shutdown:
%windor%\System32\Shutdown.exe -s -t 05
(where 05 is the seconds before shutdown starts)

Restart:
%windor%\System32\Shutdown.exe -r -t 0


2. Windows API:

"Restart" shortcut (warm reboot - Windows restart only) :
C:\WINDOWS\RUNDLL.EXE user.exe,exitwindowsExec

"Reboot" shortcut (cold reboot - restart complete) :
C:\WINDOWS\RUNDLL32.EXE shell32,SHExitWindowsEx 2

"Shutdown" shortcut :
C:\WINDOWS\RUNDLL.EXE user.exe,exitwindows


3. Windows Scripting:

(new ActiveXObject("Shell.Application")).ShutdownWindows();[Note]

Create a file remoteshutdown.js and just add the above line into it. Just double-click to run it and bring up the standard shutdown dialog.


Know any others? Post a comment...

4 Comments:

  • On a network...

    shutdown.exe -i to shutdown a remote PC.

    But I bet you already knew that. :)

    By Blogger sarahintampa.com, at 8:28 PM EST  

  • Thanx for the additional information.

    or
    shutdown \\computername

    By Blogger Veign, at 8:55 PM EST  

  • Love these shortcuts so much I put them on my desktop with an icon. Damn, I'm the laziest man I know. But I remember George Jetson coming home to complain to Jane, "I pushed buttons for 3 hours today, honey!"

    By Blogger zridling, at 12:38 AM EST  

  • I still think the future of computers and applications is ones that learn from you.

    I have still been thinking of developing an application that demonstrates what I mean. It would start learning your habits and usage and alter things based on that.

    Basically it will always be evolving to become a more efficient system / application for you.

    By Blogger Veign, at 10:29 AM EST  

Post a Comment

Links to this post:

Create a Link

<< Home