
- #Windows 10 when screensaver start goes to lock screen windows 10#
- #Windows 10 when screensaver start goes to lock screen windows#
#Windows 10 when screensaver start goes to lock screen windows#
You could add a Windows shortcut that runs. Mystify.scr, Ribbons.scr, scrnsave.scr ). I have an idea to hide all windows before launching a screensaver to prevent reading information during switching to the lock screen. The built-in screensavers should be in the windirSysWOW64 folder (e.g.
#Windows 10 when screensaver start goes to lock screen windows 10#
You can use "rundll32 user32.dll,LockWorkStation" instead of "tsdiscon", but I prefer the second way. A Windows 10 computer can be configured with a 15-minute screen lock by following these simple steps: Step 1: Click the Windows logo in the bottom left corner of the screen and click Settings. You can configure screensaver settings here (press Win+R, enter text below and press OK): control.exe can reach the screensaver settings via GUI. That's why it works only after configuring a screensaver in Windows. Now click on Change plan settings for the selected plan.

To disable that, right-click on the Windows-icon in the bottom left corner of your taskbar click on Power Options. The script takes a key value for the screensaver from the windows registry and use it to start a pre-configured screensaver. A freshly installed Windows 10 will automatically turn off your computer screens after 10 minutes. Therefore I decided to follow the way from the screensaver settings: to lock session as continuation of the screensaver. I wanted to do smth described in the title, but didn't find a way to do it (I hope, yet). 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Īnd launch it when you want to lock the session. Just think of it as shell scripting in a more pythonic environment and it's not terrible. Having a 1/4 century of bash experience, powershell is very strange, but also a bit refreshing to work with. Use Do not display the lock screen or Prevent enabling lock screen slideshow instead. ( Learn more here.) A slightly less convenient alternative is Get-Member. Note: This setting is obsolete and will not be available in the future. Unfortunately, installing it now requires the -AllowClobber option. Heres where you can find Windows more advanced settings, often not available. (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. The very first thing we recommend trying is making changes to the Registry. We access a single property with the convenient dot notation. Here, the Get-ItemProperty returns an object that has many properties. This is a pretty succinct demonstration of how powershell returns objects (complete with methods, accessors, etc.) rather than streams of text like bash. 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. This will get the value of the SCRNSAVE.EXE property from the registry. Powershell.exe -command "& (Get-ItemProperty 'HKCU:Control Panel\Desktop')."

# This works from both WSL/bash and powershell! To make this a legitimate SO answer, I'll include the simpler one: #!/bin/bash
