6

I usually have my computers set up to require a login after waking up from sleep or hibernate, but I don't want to enter a password if the screen is just turned off, either from a timeout or if I manually turn off the screen via software. This could be an external monitor that I do not want to turn off with the button on the display or an integrated screen of a laptop.

Up until now, this worked fine on all my desktops and laptops with Windows 10. I even have some desktops running Windows 11 that also do. However, I have a new laptop that runs Windows 11 that always locks the display if the screen is turned off.

If you look at this superuser question you see that a command such as powershell.exe -Command "(Add-Type '[DllImport("user32.dll")]public static extern int SendMessage(int hWnd,int hMsg,int wParam,int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)" is discussed. Or nircmd is used in this question. The same is discussed in this question. Or I could just wait the amount of time set in the energy options in Windows.

My problem is, that it does not just turn off the display, but if I try turning the display back on again by hitting some key, I am greeted with a login screen, as if I send the device to sleep. In this case, I want to see the lockscreen, because sleep should lock my device. I disabled modern standby, because it seems to cause problems for me in general and also with this behavior from what I gathered. I also found this post that also discusses my problem, but it does not work for me. It looks a bit different than the 2nd image in the article, it says that Windows should ask for a password after energy savings mode is exited, which is what I want.

So maybe the "turn display off command" is putting my device to sleep instead of just turning my display off. On all my other devices, this work great, but it is driving me crazy on this single machine. How do I configure Windows correctly so that the "turn off display" command (either manually or when I am away for a short time) does NOT lock my screen or sends my device to sleep?

EDIT: Here is screenshot of the new settings panel for login enter image description here. As you can see, the top option is locked for some reason and the unchecked checkbox below says "permit locking if you are away".

2 Answers 2

1

However, I have a new laptop that runs Windows 11 that always locks the display if the screen is turned off.

I had this issue with a new (2022) Lenovo X1 Carbon with Windows 11 Pro.

Yes, you can turn off: "Only allow Windows Hello for this device" and additionally "If you have been away for a while, should Windows require signing in".

These are both found in Start, Settings, Accounts, Sign In options.

You need to be sure you are the only one with physical access to your computer as disabling these security settings could be a risk for a public computer.

See screen shot below to assist

Disable Windows Hello for display off

.

When you walk away for Lunch or a meeting, Windows Key + l to lock the computer.

14
  • My device is a Lenovo advice as well... The problem with this answer is, that it does not do what I want. I want my device to still lock itself after a timeout I set. Just not when I manually turn off the screen. I explicitly tried to describe this. This works without a problem on my other Windows 10 or 11 devices, just not on this new machine.
    – user579825
    Commented Feb 19, 2023 at 12:32
  • I added a screenshot of the same settings dialog posted here as well. You can see that the top option is missing and the 2nd option is locked for me. However, the behavior you describe seems to be off for me.
    – user579825
    Commented Feb 19, 2023 at 12:38
  • You either have to allow the computer to lock all the time or not at all . It cannot do it sometimes. I turn off locking and then use Win+L to lock
    – anon
    Commented Feb 19, 2023 at 13:07
  • Well I want to lock my machine if I close the lid or maybe after being away for multiple hours. But I still want to be able to send a command to just turn off my screen, which I cannot now. This is what my question if about. This works perfectly fine on my other machines, but on this machine, it locks the screen for some reason. Why is the behavior different?
    – user579825
    Commented Feb 19, 2023 at 13:31
  • Besides, the settings are locked for me...
    – user579825
    Commented Feb 19, 2023 at 13:34
1

I may have a couple workarounds/solutions for this:

  • If you don't mind the lock screen appearing on screen wake (but easily dismissable with a key press/etc), you can manually edit the lock screen delay (the setting Windows Hello disables) in the registry at Computer\HKEY_CURRENT_USER\Control Panel\Desktop\DelayLockInterval. A caveat here is that opening the settings menu that lets you configure sign-in options will overwrite that key (for example when disabled due to Windows Hello, it will revert to 0 (always lock)). Windows updates will probably also revert it, but rebooting alone doesn't seem to. You may have to script it to what you want at boot, change security ownership of that key to prevent the OS from modifying it or else just manually change it any time it gets clobbered...
  • The above wasn't good enough for me because the lock screen itself still appears, delaying interaction with apps until it's dismissed plus the few seconds for the app to regain focus. An improved alternative involves enabling a blank screen saver. Open the screen saver menu, select the Blank option and set the timeout to whatever you want and with the box unchecked. You also need to change the Screen and sleep setting in Power Options to turn off the screen after a longer delay than the Screen Saver setting. This second delay will trigger the lock screen.

You must log in to answer this question.

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