I would like to have my win7 desktop lock after say 15 minutes of idle time. I also want my screensaver to start at 5 minutes of idle time.

I tried using programs that run a command after a certain amount of "idle" time, like Idle Start or Idle Controller. These programs however, seem to calculate idle time themselves, based on mouse movement and keyboard activity. And this will lock my screen while I'm watching a movie.

When you watch videos, your mouse and keyboard are idle, but Windows knows not to start the screensaver or turn off your display.

Is there any method to attach an event (lock the screen) to whatever Idle timer Windows uses, the one that is aware of videos and games and whatnot?

Alternatively, it would be awesome if I could lock the screen when my monitor turns off (which is already set at 15 min).


In case anyone is unclear, I do not want my computer to sleep. There are settings in Windows to lock the screen: 1. on screen saver, and 2. on wake. I do not want either of those.

I was asking if anyone knows of any "arcane" tricks. Could Task Scheduler or a registry hack help?

2 Answers 2


Set your screen saver to lock when it comes on, then open regedit.exe to

HKey_Local_Machine\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\

Find the entry on the right hand side of the screen for ScreenSaverGracePeriod (if it's not there, create it as a REG_SZ. Add (or change) the value to be 600 (that's 600 seconds, or 10 minutes).

Now, your screen saver will come on at 5 minutes, and you have an additional 10 minutes past that to wiggle your mouse and come back. After the screen saver has been on form 10 minutes the computer will automatically lock itself.

  • For completeness, in case you don't have a ScreenSaverGracePeriod entry, then create one as a DWORD (32-bit) Value, and open it, and inside choose Decimal, and write the amount of time, in seconds. Confirmed to still work in windows 10 thank god Jul 3, 2020 at 23:47

It may be obvious to others but after testing I had to check the box to display log on screen in Screen Saver Settings window to get it to work correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.