10
5
As the title asks (Windows 7). (How) can I change the time until the screensaver kicks in from the command line? Is it even possible?
Normally I am happy with a 5 minute setting, but occasionally I want to make it longer. I would like the two lengths bound to hot-keys (I know how to do that).
I guess I could record two macros and use those, but I just wondered if there are any command line options (including registry updates) that I can use to tell Windows to start the screen saver after X minutes of inactivity.
(please note, I do not want to start the screen saver immediately; I want to change the length of time Windows will wait before starting it)
Thanks in advance.
[Answer] I finally used a variation on the answer from @Gjordis - but all credit goes to him.
I didn't see why we needed 3 operations : add, delete then rename and reduced that to two.
Since I want to bind to a hotkey, I need to execute two comamnds in one. Normally, one can separate the commands with a semicolon and issue them on one line (e.g dir c:;dir d:
). That gave errors with the reg
command, so in the end I have two batch files. The contens are identitcal, only the duration changes.
On strange thing - the value is correctly written to the registry, but Control Panel/Personalize/Screen saver does not alwys update its GUI. However, I tested and the screen saver does behave as expected.
@echo off
reg delete "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOut /f
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOut /t REG_SZ /d 180 /f
If this helps you, please upvote the question ;-)
That works :-) The first time only :-( presumably because I didn't have a registry entry the frist time, so could add, but might need to modify subsequently? +1 for trying. Thanks – Mawg says reinstate Monica – 2013-03-05T08:04:08.797
1Edited to hopefully work other times too – Gjordis – 2013-03-05T08:14:59.863
+1 Well, that's trange. I can see that it is updating the registry key, but when I right click the desktop (or go via control panel) and choose "peronalize", it still shows 5 mintes on the GUI. If I set 10 seconds via registry, the screen saver does not start after 10 seconds (or even a few minutes). If I set 1 minute in the GUI then it does start after 1 minute (and it updates the registry correctly). – Mawg says reinstate Monica – 2013-03-05T08:44:32.383
Perhaps it has a valid value -range – Gjordis – 2013-03-05T08:46:50.400
+1 I used a variation on your answer and have posted it in the qustion above. Thanks for your help – Mawg says reinstate Monica – 2013-03-06T02:35:01.517