Kitz Forum

Computer Software => Windows => Windows Tips & Tutorials => Topic started by: Floydoid on February 07, 2009, 12:04:52 PM

Title: Windows Shutdown Shortcuts
Post by: Floydoid on February 07, 2009, 12:04:52 PM
The windows shutdown procedure (click start / turn off computer, etc) is in my opinion a bit cumbersome.  A neat way to sidestep this is to create a shutdown shortcut on your desktop.

Right-click on your desktop, choose new/shortcut and in the location box type (or C&P):

C:\WINDOWS\SYSTEM32\shutdown.exe -s -t 00

click 'next' and give it a name, e.g. Shutdown

click finish, and now you can assign an icon to it, so rt-click on the new shortcut and choose Properties, then click on 'change icon'.  You will get a warning message but just click on 'OK' and it will show you the available icons within shell32.dll, where you can find the nice red square with a white circle & vertical line.  Highlight it and click OK, then click OK on the file properties dialogue.  Job done.

If you're feeling brave enough you can drag the shutdown icon to the quicklaunch bar, but be careful not to accidentally click on it!

There are also a couple of variants you can use:

C:\WINDOWS\SYSTEM32\shutdown.exe -l -t 00 (for logoff)

C:\WINDOWS\SYSTEM32\shutdown.exe -r -t 00 (for restart)

This procedure is for XP.  I have no idea if it works in Vista, but I'm sure someone can enlighten us on that.



[As a postscript, in Windows 98 (and possibly for the rest of the win9x series), the code for the shortcut is:

C:\WINDOWS\RUNDLL.EXE user.exe,exitwindows
]
Title: Re: Windows Shutdown Shortcuts
Post by: HPsauce on February 07, 2009, 12:13:48 PM
Or just press the power button briefly...... ;)
Title: Re: Windows Shutdown Shortcuts
Post by: Floydoid on February 07, 2009, 12:45:39 PM
Hmmm, the only time I use the power button for shutting down is on the rare occasion when the PC locks up.  I've always been of the opinion that shutting down via a software procedure is much safer... others may disagree of course.
Title: Re: Windows Shutdown Shortcuts
Post by: roseway on February 07, 2009, 12:53:42 PM
With most modern motherboards, a brief press of the power button triggers a proper OS shutdown or restart, depending on how the OS is set up.
Title: Re: Windows Shutdown Shortcuts
Post by: Floydoid on February 07, 2009, 01:01:16 PM
Oh for the days of Windows 3 & 386 machines when you just exited to a DOS prompt and then pressed the power button!
Title: Re: Windows Shutdown Shortcuts
Post by: UncleUB on February 07, 2009, 01:09:25 PM
Oh for the days of Windows 3 & 386 machines when you just exited to a DOS prompt and then pressed the power button!

And real butter on ar bread.  :D
Title: Re: Windows Shutdown Shortcuts
Post by: oldfogy on February 07, 2009, 01:25:51 PM
> This procedure is for XP.  I have no idea if it works in Vista, but I'm sure someone can enlighten us on that.

There are some "Add-ons" that you can install on Vista that are also formatted with the appropriate icon for Restart and Shut-down.


> If you're feeling brave enough you can drag the shutdown icon to the quicklaunch bar, but be careful not to accidentally click on it!

I prefer to have mine "Pinned" to on the start menu.
That way with it being larger I think it's not quite so easy to accidentally click on it.
Title: Re: Windows Shutdown Shortcuts
Post by: Floydoid on February 07, 2009, 01:28:12 PM
Thanks for the info OF :)
Title: Re: Windows Shutdown Shortcuts
Post by: Floydoid on September 24, 2020, 08:44:37 PM
[Update]

This is what works in Windows 10 (and probably 7, 8, 8.1).

1) First right-click on the desktop, choose New and then Shortcut.

2) In the shortcut location box, you’ll need to enter the correct command:

Shutdown Computer   Shutdown.exe -s -t 00
                OR shutdown /s /t 0

Restart Computer          Shutdown.exe -r -t 00

Lock Workstation          rundll32.exe User32.dll,LockWorkStation

Hibernate Computer    rundll32.exe PowrProf.dll,SetSuspendState

Sleep Computer         rundll32.exe powrprof.dll,SetSuspendState 0,1,0

3) Give the shortcut a name.

4) Rt-click, go to properties / change icon. Choose from either C:\windows\system32\shell32.dll, or C:\windows\system32\imageres.dll, or C:\Windows\System32\powrprof.dll

These variants also work:
Shutdown           shutdown.exe /s /t 0 
Log-out      shutdown.exe /l /t 0 
Restart      shutdown.exe /r /t 0 
Title: Re: Windows Shutdown Shortcuts
Post by: banger on September 25, 2020, 07:57:49 PM
Very useful.
Title: Re: Windows Shutdown Shortcuts
Post by: g3uiss on September 25, 2020, 10:20:32 PM
Of course the “t” can be changed to provide a delay also useful