up vote 6 down vote favorite
1
share [g+] share [fb]

I like the Windows-L keyboard shortcut to lock the computer. Are there similar shortcuts for "Log Off" and "Standby"? Is it possible to remap Windows-L to a different function?

link|improve this question
feedback

5 Answers

up vote 10 down vote accepted

With an AutoHotkey script, you can remap the Win+L shortcut and create another one for Sleep (I chose Win+S, normally not used unless you use OneNote):

#l::         ; Win+L
Shutdown, 0  ; this is the code for Log Off
return

#s::         ; Win+S
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0) ; DLL call to sleep
return

There is more detail on the DLL call in AutoHotkey's help file:

; Call the Windows API function "SetSuspendState" to have the system suspend or hibernate.
; Windows 95/NT4: Since this function does not exist, the following call would have no effect.
; Parameter #1: Pass 1 instead of 0 to hibernate rather than suspend.
; Parameter #2: Pass 1 instead of 0 to suspend immediately rather than asking each application for permission.
; Parameter #3: Pass 1 instead of 0 to disable all wake events.
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
link|improve this answer
feedback

Standby

  • create a new text file and put this on it

rundll32 powrprof.dll,SetSuspendState

  • save it as "standby.bat" and create a shortcut of it on the desktop

  • right-click the shortcut, select propriety and edit its shortcut key to CTRL + ALT + S

now CTRL + ALT + S will put your computer in standby.

Logoff

  • create a new text file and put this on it

logoff

  • save it as "logoff.bat" and create a shortcut of it on the desktop

  • right-click the shortcut, select propriety and edit its shortcut key to CTRL + ALT + L

now CTRL + ALT + L will logoff.

link|improve this answer
Do shortcuts' Shortcut keys actually work now? Unpossible! I gave up trying to use those back in Win95. :) – JMD Nov 19 '09 at 21:00
3  
You don't really need to create a batch file; you can create a shortcut directly to the logoff executable. – intuited Feb 28 '11 at 18:02
feedback

There is a keyboard solution using existing shortcuts, though not as a single chord (meaning release each key before pressing the next):

[Start], [right arrow], [enter] - last used shutdown action
[Start], [right arrow], [right arrow] - select shutdown action

Found it at http://superuser.com/questions/16327/what-are-your-favourite-less-well-known-keyboard-shortcuts-in-windows

link|improve this answer
feedback

This tutorial is for Windows Vista, but should work also for Windows 7.

Vista Log Off Shortcut Creation

link|improve this answer
feedback

The Windows 7 hibernate shortcut key is more like a PlayStation secret function!

⊞ Win, , , then:

  • H - hibernate
  • S - sleep
  • U - shutdown

It helps when you have lost your screen on the way! An alternative shortcut to hibernate is:

⊞ Win + D, Alt + F4, H, Enter

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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