Is there a keyboard shortcut to start a screensaver?
Solution 1:
There are several ways to achieve this:
-
A simple shortcut – as Peter Maxwell suggested – will do. To lock the workstation on resume, just make the shortcut point to the following:
cmd /c start /wait scrnsave.scr /s && rundll32 user32.dll,LockWorkStation
Note that you cannot specify the Win key as part of the keyboard shortcut. Windows only allows Ctrl + Alt as modifier.
This has also the drawback of locking the workstation after the screensaver has ended, which allows a short glimpse at the desktop.
-
Download NirCmd, execute
nircmd.exe
inside the archive and clickCopy To Windows Directory
.Now, create a shortcut pointing to the following:
cmd /c nircmd lockws && nircmd cmdwait 1000 screensaver
This will start the screensaver 1000 ms after the screen has been locked, which is more secure.
NirCmd will always launch the default screensaver (which may or may not be what you want).
-
If you insist in the Win key for the keyboard shortcut, you can use AutoHotkey:
Download and install the latest version.
-
Save one of the following scripts as
screensaver.ahk
, using your favorite text editor:#s:: RunWait, scrnsave.scr /s Run, rundll32 user32.dll`,LockWorkStation return
#s:: Run, nircmd lockws Run, nircmd cmdwait 1000 screensaver return
Double-click the file to run the script.
(optional) Copy the script (or a link to it) in the
Startup
folder.
Pressing Win + S (
#
represents the Win key) will have the same effect as executing the corresponding shortcut from the previous items.
Solution 2:
Create a shortcut to C:\Windows\System32\scrnsave.scr
then assign a shortcut key in Properties.
scrnsave.scr is a black screensaver, choose another scr file for the screensaver you wish to load.
Source of information
Solution 3:
There's a LifeHacker article titled PushMonitOff Links Hot Key Combo to Monitor Power Switch about a tiny app which will turn your monitor off via a configurable hot key combination. As mentioned in the article, the app can be downloaded from here.
Alternatively, you could use the AutoHotKey utility with a simple script to do what you want. Here's the one I currently use which just turns the monitor off (it doesn't lock the computer because I've commented-out the second line that would have done that):
^#l:: ; ctrl+winkey+l
;SendInput #l ; lock the computer (not currently enabled)
Sleep 1000 ; Give user a chance to release keys (in case their release would wake up the monitor again)
SendMessage, 0x112, 0xF170, 2,, Program Manager
; 0x112 is WM_SYSCOMMAND, 0xF170 is SC_MONITORPOWER
; Note for the above: Use -1 in place of 2 to turn the monitor on.
; Use 1 in place of 2 to activate the monitor's low-power mode.
return