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

33

6

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?

Gabe Moothart

Posted 2009-11-19T19:31:23.017

Reputation: 568

They better would not exist, since these are highly destructive actions. – kinokijuf – 2014-05-14T13:12:17.560

Answers

23

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)

Snark

Posted 2009-11-19T19:31:23.017

Reputation: 30 147

Note that AutoHotKey_L is now the main development branch. See http://en.wikipedia.org/wiki/AutoHotkey and http://l.autohotkey.net/

– Ron Klein – 2012-10-09T02:13:15.113

25

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.

user8228

Posted 2009-11-19T19:31:23.017

Reputation:

1@intuited is right. I did both ways. I'm in Windows 8.1. The batch method needs administrator priviledges every time you hit the shortcut to run. By having a shortcut of the logoff executable directly to desktop you can CTRL + ALT + L without a prompt. Much better that way. – Nikos – 2016-12-26T14:24:34.803

10You don't really need to create a batch file; you can create a shortcut directly to the logoff executable. – intuited – 2011-02-28T18:02:14.177

1Do shortcuts' Shortcut keys actually work now? Unpossible! I gave up trying to use those back in Win95. :) – JMD – 2009-11-19T21:00:31.603

1+1 because it is a solution that doesn't involve installing another (albeit flexible) program just to do one thing. – Richard – 2013-06-24T10:58:14.257

13

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

⊞ Win, , , then:

  • H - hibernate
  • S - sleep
  • U - shutdown
  • O - lock
  • L - log off

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

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

it24

Posted 2009-11-19T19:31:23.017

Reputation: 131

1didnt know about the WIN+D, Alt+F4. tnx. p.s.WIN+rightArrow, moves my windows to the right - oops, you mean win , let go, then right arrow twice. got it! – Mickey Perlstein – 2015-11-20T07:51:46.163

8Though technically "win, ->, ->, s" isn't a real short cut, as you're just navigating to the sleep button via your keyboard :\ – None – 2012-11-04T13:50:32.177

You're right Bob. They are not short-cuts. My screen blacks out when I connect to the PC remotely, and never comes back. I use a keyborad Sleep button to sleep the PC and then bring it back, and its fine. But if I didn't have that (or the screen is locked), there does not seem to be a key-code to reproduce the same thing. – Nicholas – 2013-04-09T17:05:59.720

5

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

  • Win, , Enter - last used shutdown action
  • Win, , - select shutdown action

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

matt wilkie

Posted 2009-11-19T19:31:23.017

Reputation: 4 147

2

You can use the Alt+F4 shortcut then choose what you want in the resulting dialog box, or you can make one of them your default by doing the following:

  • Click on the start button
  • Right click on the arrow beside the bottom Power Settings button, and choose the Properties in this context menu. It should be the only one.
  • In that dialog box choose Sleep (or whatever default you want) in the Power button Action field, then apply it and click OK.

When you're ready to put your PC to sleep or whatever you chose, use the Alt+F4 keyboard shortcut and then hit Enter. Whatever you set in the first step will be the default action that is applied when you hit Enter.

Stan

Posted 2009-11-19T19:31:23.017

Reputation: 19

1

create a shortcut inside run

shutdown /l

then

set to shortcut key to  WIN+ALT+L

done

Mickey Perlstein

Posted 2009-11-19T19:31:23.017

Reputation: 111

1

This should really help out: Windows 7 Keyboard Shortcuts / Windows / Keyboard-Shortcut.com

Shutdown is actually WinEnter.

ZachC

Posted 2009-11-19T19:31:23.017

Reputation: 11

1

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

Vista Log Off Shortcut Creation

Chris

Posted 2009-11-19T19:31:23.017

Reputation: 1 688

0

Shortcut for logging out (Win 10/8/7/Vista)

Press Ctrl+Alt+Delete, followed by Alt+L.

All Ctrl+Alt+Delete shortcuts

  • After opening screen with Ctrl+Alt+Delete:
    • Lock this computer: Alt+K
    • Switch Users: Alt+W
    • Log off: Alt+L
    • Change a password...: Alt+C
    • Start Task Manager: Alt+T

Ctrl+Alt+Delete screen

Stevoisiak

Posted 2009-11-19T19:31:23.017

Reputation: 8 152

0

Win + R "shutdown /L", the command line log off which can also be used as shortcut icon with custom user shortcuts.

Tanguy

Posted 2009-11-19T19:31:23.017

Reputation: 139

-1

Under windows7, check out the "shutdown" command from the cmd prompt.

Unfortunately, while it has hibernation as an option, it does not include "sleep"

Beverly Howard

Posted 2009-11-19T19:31:23.017

Reputation: 9

4This isnt a keyboard shortcut? – Simon Sheehan – 2012-02-20T15:59:30.130

-1

create a shortcut .. put the location of the file as logoff.exe and name the shortcut whatever.. done.. right click shortcut go to properties.. change icon and pick an icon image for your shortcut.

and if you want it to be a hotkey.. then right click the shortcut and notice the hotkey box ... click it.. and then press a combination of keys.. bang.. done.. your welcome.

ELUDZ

Posted 2009-11-19T19:31:23.017

Reputation: 1

2

This is the same answer as provided by @Revolter: http://superuser.com/a/72807/23133

– Ƭᴇcʜιᴇ007 – 2013-06-21T16:25:34.497

-2

Maybe it is buried in here somewhere or maybe I do not understand the request, but the logout part is easy. Instead of using a keystroke or two, the easiest way is to create a shortcut with an icon on the screen you can call Logout User or whatever strikes your fancy. The shortcut should simply contain C:\windows\system32\shutdown.exe /L /F Double click on the icon and you are logged out.

LexHank

Posted 2009-11-19T19:31:23.017

Reputation: 1

This duplicates another answer and adds no new content. Please don't post an answer unless you actually have something new to contribute. – DavidPostill – 2016-10-25T08:37:56.247