6

Is there an option to turn off the display while the screen is locked?

I do not want to turn off display based on idle time as the "Power & sleep" settings allow. I do not want the screen to turn off after a minute when the screen is not locked.

I do want the screen to turn off when the screen is locked.

This currently works on my laptop. The display is turned off after the screen is locked for a minute. It is not working on a new Windows 10 Pro install on my desktop which is fully updated. When the screen is locked, the display stays on indefinitely.

Update: This doesn't work on my laptop either. Did something change?

I really can't believe that this isn't an option and feel like I am overlooking something obvious as a user. We aren't really expected to run third party software for something like this, are we? I am able to easily set preference in Ubuntu and I'm pretty sure it was set as an option on my laptop. What am I missing?


What I have tried

Searching for solutions brings suggestions of running task scheduler with a trigger to run third party software that will turn off the screen when the screen is locked. I do not wish to install third party software for a basic Windows setting that I know to work on other systems.

I could not find any appropriate duplicates of this question. The only thing close was a question about an apparent bug that was fixed in a later Windows update1, except that user seemed to want a general idle time applied and I do not.

I have turned off my USB wireless mouse while testing.

I have confirmed there is no software preventing the screen from turning off:

powercfg /requests

DISPLAY: None.

SYSTEM: None.

AWAYMODE: None.

EXECUTION: None.

PERFBOOST: None.

ACTIVELOCKSCREEN: None.

I have generated an energy report that shows no helpful information by running:

powercfg /energy

I have tried running the power troubleshooter from control panel with no helpful fixes.

1
  • To my experience by default when Windows is locked the screen timeout should be 2 minutes no matter what timeout is configured by default.
    – Robert
    Jul 29, 2022 at 7:20

3 Answers 3

2

See this: https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/monitor-powers-off-when-pc-locked

You can use this to adjust screen-off when locked.

EDIT: Actually this seemed to work better: https://www.winhelponline.com/blog/lock-screen-display-off-timeout-windows-10-8/

  • Start Regedit.exe and go to the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\8EC4B3A5-6868-48c2-BE75-4F3044BE88A7

  • Double-click the value named "Attributes". Its value data is set to 1 by default. Change the Attributes data to 2.

  • Launch Powercfg.cpl to open the Power Options Control Panel applet.

  • In the Power Options Control Panel, click Change Power Settings link next to your current power plan.

  • Click Change advanced power settings under "Display".

2
  • Please quote the pertinent points here as links can disappear Jan 16, 2023 at 19:56
  • 1
    This seems like it will increase the timeout from one minute to two, but the question is asking to set the timeout (at least for the initial lock) to zero. Does this allow that?
    – Mike Hill
    Oct 16, 2023 at 16:36
1

I'm not able to find any way to do this out of the box. However, I was able to put together a short PowerShell script and Task Scheduler task to handle this. This is working for me in Windows 10.

  1. Create the PowerShell script:
    Add-Type -TypeDefinition @"
    using System;
    using System.Runtime.InteropServices;
    public class User32 {
        [DllImport("user32.dll", SetLastError = true)]
        public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    
        [DllImport("user32.dll", SetLastError = true)]
        public static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
    }
    "@ 
    
    $WM_SYSCOMMAND = 0x0112
    $SC_MONITORPOWER = 0xF170
    $MonitorOff = 2
    $hWnd = [User32]::FindWindow([NullString]::Value, "Program Manager")
    [User32]::SendMessage($hWnd, $WM_SYSCOMMAND, $SC_MONITORPOWER, $MonitorOff)
    
  2. Create the Task Scheduler task:
    1. Open Task Scheduler (taskschd.msc)
    2. Click "Create Task..."
    3. In "General":
      • Provide a task name (e.g., "Turn Off Monitor on Lock").
      • Select "Run only when user is logged on".
    4. In "Triggers":
      • Create a new trigger for "On workstation lock".
      • Ensure "Any user" is selected for the trigger.
    5. In "Actions":
      • Create a new action for "Start a program".
      • For "Program/script", enter powershell.
      • For "Add arguments", enter the quoted string of the PowerShell script path. E.g.: "C:\Users\MyUser\Documents\Scripts\TurnOffMonitors.ps1".

If you're comfortable installing nircmd (no specific concerns with Nir's work, but I limit downloaded utilities), the PowerShell script can be replaced with nircmd.exe monitor off (source).

I'll also note that I created this and then disabled it shortly after, since the added delay from my monitors turning back on just wasn't worth it for me. YMMV.

Sources:

0

I do not want to turn off display based on idle time as the "Power & sleep" settings allow. I do not want the screen to turn off after a minute when the screen is not locked.

Here's the key though. For whatever reason Windows connects the idle display turn off setting with lock screen display turn off behavior:

  • If idle display turn off is set to "never", it won't turn off the display on the lock screen, ever.
  • If idle display turn off is set to anything other than "never", it will always turn off the display upon locking after 1 minute. It doesn't matter if you set it to 1 minute or 5 hours (the maximum value), it will always turn off the display precisely after 1 minute on the lock screen.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .