Start automatically screen saver when locked - Windows 10

When you lock your computer with the Windows + L keyboard shortcut, the screen saver is not automatically started before a certain period of inactivity set in the Windows power options. You can start the screen saver immediately after locking.

1-A default screen saver must be set on your computer. If you have not already done so, follow this tip.

2-Allow PowerShell scripts to run on your computer by following this trick.

3-Open the notebook and paste the following code:

$SendMessage = Add-Type -MemberDefinition @"
[DllImport("user32.dll")] public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);
"@ -Name "Win32SendMessage" -Namespace Win32Functions -PassThru
$SendMessage::SendMessage(0xffff, 0x112, 0xF140, 0)



4-Click the File menu, and then click Save As.



5-Pull down the Type list and select the All files option.



6-Name the file stand.ps1 and save it in your documents.



7-In the Taskbar search box, type Scheduler and click Task Scheduler.



8-Click Create Task.



9-Give the task a name, and then open the Shutter tab.



10-Click New.



11-Pull the Start Task list and select the Lock to Workstation option. Click OK.



12-Open the Actions tab and click New.



13-In the Program / Script field, enter the powershell -file command "C: \ Users \ Clement \ Documents \ standby.ps1", replacing C: \ Users \ Clement \ Documents with the path where you put the powershell script. Click OK.



14-Click Yes and confirm with OK.




Commentaires