So I've seen a few posts on this topic, however nothing offering a
solid conclusion. I'm writing a script that is set to run on login
that resets the screensaver settings to a default setting, most
importantly overwriting the timeout to 10 minutes regardless of what
it is set to. I have a script that does that fine, the only problem
is that once the script runs, the machine needs to be rebooted again
for the change to be updated in the display properties. Some people
have said that i need to run user32.dll, updateperusersystemparameters
in order to fix the problem, however that doesnt' seem to work for
me. Surely there has to be some way of getting this done. Does
anyone have any suggestions? Here is my current script:
Set oShell = CreateObject("WScript.Shell")
oShell.RegWrite "HKCU\Control Panel\Desktop\ScreenSaveTimeOut", "600"
oShell.exec "%windir%\System32\RUNDLL32.EXE
user32.dll,UpdatePerUserSystemParameters", 1, True