Are there Windows 7 keyboard shortcuts for Log Off and Standby?

Solution 1:

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)

Solution 2:

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.