Stormfolk Posted October 3, 2011 Share Posted October 3, 2011 I have been working on a script to make settings for the screensaver for All Users on a Windows 7 Pro PC. In my script, I also want to update the waiting time before the screensaver starts by adjusting a registry key.I've been looking on the internet for quite some time now, but I can't find the right key that does it. First I thought "HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveTimeOut", 600, "REG_SZ" would do the trick, but that's not the one I need. The red box is the part I want the registry key for. The "5" should be "10". I know it can be easily done by rightclicking the desktop, changing screensaver settings with the console, but I really need to do it with the registry key.Anyone has an idea? Stormfolk | TRWF Clanfriend Link to comment Share on other sites More sharing options...
obfuscator Posted October 3, 2011 Share Posted October 3, 2011 There are applications that compare registry keys. Basically you can scan the registry and record it, make your change, and scan it again. System mechanics is one such app, but you'll have to pay for it. It also might only tell you if a key has been added or removed, not had it's value changed, so don't quote me on it. "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti Link to comment Share on other sites More sharing options...
D. V. Devnull Posted October 3, 2011 Share Posted October 3, 2011 Stormfolk, I believe the registry key you're looking for is the one at the Login Screen? If so, then it's located in the following spot... HKEY_USERS\.DEFAULT\Control Panel\Desktop...and control of the needed items is then as you thought, marked with... ScreenSaveTimeOut SCRNSAVE(dot)EXE[Change the "(dot)" into an actual dot in your visualization of it... I'm having to work around a rude filter here.] ...which allows you to adjust both time and which screen saver is used. BTW, Windows 7 may try to push UAC at you and deep-six what you're doing if you don't go in with full admin priveleges. (Simply just mentioning that part for the uninformed third party who might read this thread.) :geek: Have fun, but remember the original values (or just make a proper reset registry script) in case you want them back some time in the future, okay? :shades: ~Mr. D. V. "I think that's what you're looking for?!?!?" Devnull and normally with a cool mind.(Warning: This user can be VERY confusing to some people... And talks in 3rd person for the timebeing due to how insane they are... Sometimes even to themself.) Link to comment Share on other sites More sharing options...
Markup Posted October 3, 2011 Share Posted October 3, 2011 Cant help you with the registry but heres the winapi version http://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspxBOOL WINAPI SystemParametersInfo( __in UINT uiAction, __in UINT uiParam, __inout PVOID pvParam, __in UINT fWinIni );SPI_GETSCREENSAVETIMEOUT 0x000ERetrieves the screen saver time-out value, in seconds. The pvParam parameter must point to an integer variable that receives the value. SPI_SETSCREENSAVETIMEOUT 0x000FSets the screen saver time-out value to the value of the uiParam parameter. This value is the amount of time, in seconds, that the system must be idle before the screen saver activates. Link to comment Share on other sites More sharing options...
Corvus Posted October 3, 2011 Share Posted October 3, 2011 Well, to answer specifically the Screensaver time registry is : "HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveTimeOut" (there is a duplicate value in your user account as well, but they change together.) Your issue is that you need to reload the user settings, which is not something I can help with. Thanks to DrCue at DeviantArt for the signature source Link to comment Share on other sites More sharing options...
Stormfolk Posted October 3, 2011 Author Share Posted October 3, 2011 The problem indeed seems to lie with reloading/refreshing the settings. It works now. The script: Set WshShell = WScript.CreateObject("WScript.Shell") 'Variable for the screensaver scrsvr = "C:\Windows\SysWOW64\Screensaver Operations.scr" 'Assign the screensaver to the current user in the registry WshShell.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\SCRNSAVE[Caution: Executable File]", scrsvr, "REG_SZ" 'Activate the screensaver WshShell.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveActive", 1, "REG_SZ" 'Screensaver has to wait 600 seconds (10 minutes) before it starts WshShell.RegWrite "HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveTimeOut", 600, "REG_SZ" I just got confused by the fact that for all settings aside from ScreenSaveTimeOut you immediately get a visual result. For ScreenSaveTimeOut, the user first has to log off and on again to see the changes. Thanks everyone! Stormfolk | TRWF Clanfriend Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now