What's the fastest way to lock your screen?

22

3

Ideally, I'd like to be able to press 1 button on my keyboard and have the screensaver come up, and not just a preview, but the actual screensaver such that when I try to access the computer it shows a login screen (as per my screensaver settings). I say this last part in particular because I don't want a shortcut to the "Preview" button, which doesn't seem to require me to log back in after the preview (which is contrary to my settings and what I'm looking for).

If a single button isn't possible (i.e. via some local mapping or keys or whatnot), perhaps a quick combination of keys?

If all else is not possible, it would be handy to be able to trigger my screensaver via a shortcut on my desktop.

Are any of these doable? If so, how?

AllenP

Posted 2011-10-07T21:00:09.327

Reputation: 247

The answer you accepted is for a question you didn't ask clearly, IMO. This question should read How do I lock my windows PC with one key? – Fuhrmanator – 2015-05-17T00:08:38.923

Related: How to lock Windows 7 session with just key strokes?

– G-Man Says 'Reinstate Monica' – 2015-08-03T00:51:30.273

2People still use screen-savers? – Marc Gravell – 2011-10-08T08:20:25.123

@MarcGravell: Why not? – dmr – 2011-10-09T02:01:43.663

@dmr I (and many others) just set the monitor(s) to power down if not being used – Marc Gravell – 2011-10-09T07:02:00.990

2@MarcGravell Some monitors take time to switch back from being powered down to an active state. Mine even switches the input signal, something I don't want, which is why I need a screen-saver. – slhck – 2011-10-10T06:07:18.313

@slhck fair enough! – Marc Gravell – 2011-10-10T06:23:52.730

Some monitors take time to switch back from being powered down to an active state.   How much time? ಠ_ఠ My old CRT has to click a relay to turn on and off, but it’s still worth the extra 2-3 seconds to save 70W of electricity (which we pay for). My old LCD recovers from standby in 1-2 seconds and uses 31W; also worth the “wait”.     Mine even switches the input signal, something I don't want, which is why I need a screen-saver.   Can you set it to not do that? Do you at least use the default blank screensaver or a fancy one (3D ones suck up CPU cycles which wastes even more electricity). – Synetech – 2013-09-10T17:20:47.790

What's the fastest way to trigger your screensaver?   Hmm, I could have sworn I’ve seen multimedia keyboards with screensaver keys, but I can’t find a single photo of one on Google Images… – Synetech – 2013-09-10T17:22:02.060

Answers

34

Windows + L locks the screen immediately. Other than that, you'll need a utility to remap some other keystroke to that action.

uSlackr

Posted 2011-10-07T21:00:09.327

Reputation: 8 755

2

I see 33 upvotes for an answer that doesn't trigger my screen saver. http://superuser.com/a/643410/128228 is a good answer.

– Fuhrmanator – 2015-05-11T19:10:21.523

@Fuhrmanator does Windows-L not lock your PC? – uSlackr – 2015-05-12T20:20:46.380

Yes, it locks my PC, @uSlackr. I have two monitors and one goes blank, but the main monitor shows the unlock screen in Windows 7. http://superuser.com/a/643410/128228 does the job right away.

– Fuhrmanator – 2015-05-13T11:51:04.563

If you read the text of the question, OP implied he wanted to lock the PC, not blank the monitors. " such that when I try to access the computer it shows a login screen". My answer covered that and the OP agreed in his comments. – uSlackr – 2015-05-15T12:37:32.217

2The login screen is a side effect of the OP's settings. The title and bold faced text clearly speak of screen saver invocation. Google brought me here as I had the same question as in the title. This answer is misleading, although I see how it happened now. OP wanted to lock the computer, just as HIS screensaver does. It's a bass ackwards question. – Fuhrmanator – 2015-05-17T00:09:35.777

+1 (if I could give it to you) That's also a useful one to know :) – AllenP – 2011-10-07T21:14:14.643

Other useful ones: Windows-M minimizes all windows; Windows-E brings up My Computer; Windows-R brings up the "run" dialog. – BlueRaja - Danny Pflughoeft – 2011-10-08T07:07:43.380

I've swapped Right Alt with the Windows key ages ago to be able to press this with a single hand. :) – Tamara Wijsman – 2011-10-08T16:46:25.587

9

Sometime before there was an article on howtogeek.com:

Create Icons to Start the Screensaver on Windows 7 or Vista:
Right-click on the desktop and choose New \ Shortcut from the menu In order to launch the screensaver, you’ll need to enter the full path to the screensaver file, followed by “/s”

%systemroot%\system32\Bubbles.scr /s

You would want to substitute the name of the screensaver where you see “Bubbles.scr” above. Also note that I used %systemroot% instead of C:\windows because not every install uses the C: drive.

If you don’t know the filename, you can browse down to your system32 folder and then search for “.scr” using the search box:

Not really one button, but one icon (and you can assign a keyboard shortcut) (and is hardcoded with the screensaver)

Nivas

Posted 2011-10-07T21:00:09.327

Reputation: 609

6

If you wish to lock your computer via a shortcut, then setup a shortcut like this.

  • Filename: Lock Screen.lnk
  • Target: C:\Windows\System32\rundll32.exe user32.dll, LockWorkStation
  • Icon path: %SystemRoot%\System32\shell32.dll
  • Icon Index: 47

You can even assign a shortcut key to the shortcut if you want.

lock shortcut

Zoredache

Posted 2011-10-07T21:00:09.327

Reputation: 18 453

You can lock from the Start menu in Windows 7. It's one of the options in the menu next to Shut down. – craig65535 – 2016-05-10T17:40:14.663

Expanding off Zoredache's answer, you could just create a shortcut directly to the screensaver. This would trigger the screensaver, and if you wait longer than the idle time you set for your screensaver, the computer will be locked should you try to return. The smallest keystroke combination you can use is 3 keys with this method, as far as I know. – stoicfury – 2011-10-08T00:44:33.390

4-1 for trying to reinvent the wheel. Windows+L has done this since XP. – ThatGraemeGuy – 2011-10-08T05:21:23.413

7@Graeme Donaldson, I support a large number connecting to a terminal server. They don't have a Windows button to press. A portion of this large number of users also borders on technically illiterate, but they must be able to lock their computers. A shortcut on the desktop and pinned to the start menu and task bar make this easy for them. Also, not everyone likes to or is able to memorize a large number of keyboard shortcuts. The question also explicitly asked how to trigger via a desktop shortcut, I was simply answering the question that was asked, so I don't get the downvote. – Zoredache – 2011-10-08T19:27:41.523

5

The Mac has a functionality called hot corners, where when you move your cursor to a specified corner, the screen saver kicks in. This behavior can be duplicated in Windows 7 using an open source program called Hot Corners, which can be found here.

This would, I imagine, provide you with the fastest possible way to bring up your screensaver, as you wouldn't even have to reach for the keyboard.

Good luck!

Michael Blaustein

Posted 2011-10-07T21:00:09.327

Reputation: 150

I know of hot corners-like functionality from Compiz in Ubuntu. As a user of that, I can say it can get annoying to have hot corners, especially when overshooting a menu in the top left corner – TheLQ – 2011-10-13T01:07:29.800

4

I apologize for grave digging, but this page comes as a top search result for triggering a screensaver with a shortcut key. I thought it'd be useful to add another, updated method for doing something that few people seem to know how to do.

Note: This is a solution made for and tested on Windows 8 but should also work for Windows 7. There is a better solution for older OSes, however; check here: https://stackoverflow.com/questions/1430108/how-to-turn-screensaver-on-windows-7-by-a-code-in-cmd.

First, create a folder. Then, find a cmd.exe and copy it to the folder. Now, create a text file (don't worry about naming it yet) and paste the following code into it:

 using System;
 using System.Runtime.InteropServices;

public static class LockDesktop
{
 [DllImport("user32.dll", EntryPoint = "GetDesktopWindow")]
 private static extern IntPtr GetDesktopWindow();

 [DllImport("user32.dll")]
 private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);

 private const int SC_SCREENSAVE = 0xF140;
 private const int WM_SYSCOMMAND = 0x0112;

 public static void SetScreenSaverRunning()
 {
     SendMessage(GetDesktopWindow(), WM_SYSCOMMAND, SC_SCREENSAVE, 0);
 }

 public static void Main()
 {
    LockDesktop.SetScreenSaverRunning();
 }
}

Now, click "save as" and set the file type to "all" before saving the file as "lock.cs". Make sure to save it to the folder you created. Finally, open the CMD.exe from the folder and type in the following command:

%SystemRoot%\Microsoft.NET\Framework\v3.5\csc.exe lock.cs

Press Enter and wait a moment. You'll now find a "lock.exe" file in your folder. You can create a shortcut (send to desktop) to it and go to properties to assign a keyboard shortcut.

**Note: This will simply launch your set screensaver as if the timer ran out. If you do not have it set to display logon screen at resume, it will not lock. There is also a delay of about five seconds before it locks since this is the default behavior of screensaver so that the user has time to cancel it from locking.

If you do not want to set your screen saver to lock on resume and/or want you computer to lock instantly with the shortcut, continue reading.**

Create another text file or use the old one, it doesn't matter. Now, enter the following batch code and save it as "lock.bat".

@START lock.exe
@%windir%\system32\rundll32.exe user32.dll,LockWorkStation

Now you can create a shortcut once again and give it a keyboard command.

Leaf

Posted 2011-10-07T21:00:09.327

Reputation: 41

3Creating a copy of cmd is a very improper way of doing that. The quickest way would be to click empty space in Windows Explorer's breadcrumbs bar and type cmd <Enter>. – gronostaj – 2014-06-05T17:37:18.803

-1

Haven't tried Hot Corners, but I've had very good results with a tiny little app called Summon the Screensaver. Just Google it to find the download. You can configure where you move the cursor to activate it, how long a delay before it kicks in, and other behaviors as well. I've used it in XP and 7, but don't know whether it works in 8.

user329747

Posted 2011-10-07T21:00:09.327

Reputation: 9

dunno about the downvotes, worked for me... – meetar – 2014-10-08T20:51:07.213

as to Summon the SS: yeah, i googled it, and 90% of the results are about uninstalling it, removing it, completely uninstalling, etc. thanx, but no thanx... – None – 2015-04-08T23:17:39.230

-1

Much easier way: open: This PC, OS (C:), windows, system 32. Then find a screen saver in this folder, bubbles, mystify, ribbons whatever. Right click, choose send to, pick desktop (make shortcut) Now you have a desktop shortcut to immediately start the screen saver

NOTE: This does not engage the "lock-screen" functionality that is engaged (optionally) through standard idling trigger of screen saver.

Roger A

Posted 2011-10-07T21:00:09.327

Reputation: 11