How to turn screensaver on immediately after locking computer?

6

I am looking for a way to turn my screensaver on immediately, or turn off the screen, either when I lock the screen (WIN-L) or by clicking on something on the desktop.

I have located MonitorES as a possible solution, but it appears to be somewhat out of date and I am concerned it does not support Windows 10 particularly well as it hasn't been updated in some time. It also does not support my media player of choice (SMPlayer).

Any ideas/suggestions on how to do this via a Windows setting/shortcut or some other way?

Charles Goodwin

Posted 2016-06-08T04:49:48.423

Reputation: 299

2Win+L to lock the screen? – ejbytes – 2016-06-08T07:12:15.687

Answers

2

The built-in screensavers should be in the %windir%\SysWOW64 folder (e.g. Mystify.scr, Ribbons.scr, scrnsave.scr). You could add a Windows shortcut that runs one of these files. You could also add a shortcut key.

Jedi

Posted 2016-06-08T04:49:48.423

Reputation: 760

Agreed, screen savers are just renamed .exe to .scr files that you can actually run. – Overmind – 2016-06-08T05:15:08.810

3That won't lock the PC though. Or will it? – Charles Goodwin – 2016-06-08T06:08:01.727

Simple enough to check out following the link. I tried it, but as soon as you press Win, or any key, the screen saver disappears. – ejbytes – 2016-06-08T07:05:51.717

@CharlesGoodwin Yup, you're right.. that does NOT lock the PC. I have a screensaver on right now, and when I activate it, it does NOT lock the screen, in fact, I see the task bar at the bottom.... – Malachi – 2016-12-12T16:49:26.000

2

Answer:

I have 2 different tools for this at https://gist.github.com/RichardBronosky/c61465ed897c2f10e9bf16704d1d9af9

To make this a legitimate SO answer, I'll include the simpler one:

#!/bin/bash
# From: https://gist.github.com/RichardBronosky/c61465ed897c2f10e9bf16704d1d9af9
# This works from both WSL/bash and powershell!

powershell.exe -command "& (Get-ItemProperty 'HKCU:Control Panel\Desktop').{SCRNSAVE.EXE}"

This will get the value of the [terribly named] SCRNSAVE.EXE property from the registry. That value just happens to be a complete path to a *.scr file, and therefore you can (and I do) tell powershell to run it as a command.

Notes/Opinion:

This is a pretty succinct demonstration of how powershell returns objects (complete with methods, accessors, etc.) rather than streams of text like bash.

Here, the Get-ItemProperty returns an object [of type: System.Management.Automation.PSCustomObject] that has many properties. We access a single property with the convenient dot notation. (I have to admit that even though I can write sed directly into a script without testing it at the CLI, this IS better.) There is a useful tool for exploring objects that is recommended by a Microsoft technet blogger. Unfortunately, installing it now requires the -AllowClobber option. (Learn more here.) A slightly less convenient [flat] alternative is Get-Member. (Just pipe output to it.)

Having a 1/4 century of bash experience, powershell is very strange, but also a bit refreshing to work with. Just think of it as shell scripting in a more pythonic environment and it's not terrible... except for those backslashes.

Bruno Bronosky

Posted 2016-06-08T04:49:48.423

Reputation: 1 251

This doesn't look like it will lock the computer as well. – mbomb007 – 2019-09-12T16:46:23.603

1

This opensource app adds hot corners, and you can set one of them with the Lock option. The website is minimalist but the app works fine on Windows 10 and with multiple monitors.

The last build lacks one feature, which is the ability to put the monitor to Sleep rather than locking. If you need that, you can compile the source yourself.

Giacomo Lacava

Posted 2016-06-08T04:49:48.423

Reputation: 121

0

I offer the next solution: Create a .bat file with the next content:

for /f "tokens=3" %%a in ('reg query "hkey_current_user\control panel\desktop" /v scrnsave.exe') do start "" /wait /d "%%~dpa" "%%~nxa" /s
tsdiscon

And launch it when you want to lock the session.

Explanation.

I wanted to do smth described in the title, but didn't find a way to do it (I hope, yet). Therefore I decided to follow the way from the screensaver settings: to lock session as continuation of the screensaver.

The screensaver settings

The script takes a key value for the screensaver from the windows registry and use it to start a pre-configured screensaver. That's why it works only after configuring a screensaver in Windows. You can configure screensaver settings here (press Win+R, enter text below and press OK):

control.exe desk.cpl,screensaver,@screensaver

Also:

  1. You can reach the screensaver settings via GUI.

  2. You can use "rundll32 user32.dll,LockWorkStation" instead of "tsdiscon", but I prefer the second way.

  3. I have an idea to hide all windows before launching a screensaver to prevent reading information during switching to the lock screen.

  4. You can try to find 3rd party app =)

I wanted to find info how to do the same from cmd, but when I didn't find necessary information I decided to join information from the next resources:

Similar question on StackOverflow

Configure screensaver via cmd

and, of course, for /?, reg /? etc. =)

Val

Posted 2016-06-08T04:49:48.423

Reputation: 1

-1

  1. Open text editor
  2. Paste this: control.exe desk.cpl,screensaver,@screensaver
  3. Save as batch file
  4. Copy batch file to desktop or wherever.
  5. Finish

Jerry Rhino

Posted 2016-06-08T04:49:48.423

Reputation: 1

This merely opens the Screen Saver Control Panel. We want to activate the screen saver as if the system had been idle for the timeout and, e.g., trigger the requirement that the user enter the password to access the computer (WITHOUT sleeping the display). – binki – 2019-03-19T19:53:19.393

-1

Solution: Windows 7/8/10

Right-click on desktop, select New > Shortcut with Target set to:

C:\Windows\explorer.exe "C:\Windows\System32\Fliqlo.scr

(or some another screensaver, Fliqlo.scr is just example)

...you are welcome..

MIlan

Posted 2016-06-08T04:49:48.423

Reputation: 1

You can run a screensaver directly. – RalfFriedl – 2019-08-23T18:34:53.020

Doesn't add anything not already posted in https://superuser.com/a/1086698/174140.

– 174140 – 2019-08-24T11:19:15.570

-1

It's an old question but I found a software that you can use and I'm using btw.

https://github.com/ukanth/monitores

Just activate "Auto SSaver On" and after you lock your PC SS turns on

->Software

Explanation & HowTo

https://www.howtogeek.com/146439/how-to-make-windows-start-the-screensaver-immediately-when-locked/

abdulsamed kayaduman

Posted 2016-06-08T04:49:48.423

Reputation: 1

-2

This is definitely a hack and will require programming. It was an interesting idea and so I used keywords and found out for you.

OpenSource idea:
http://www.howtogeek.com/146439/how-to-make-windows-start-the-screensaver-immediately-when-locked/

Download this and install for your desired result.

ejbytes

Posted 2016-06-08T04:49:48.423

Reputation: 1 819