Tomcat76 Posted October 30, 2020 Posted October 30, 2020 The Windows 7 PCs here regularly lose their screensaver after a reboot. The name/value with the screensaver name is missing from the registry when that happens, so I want that name/value to be re-added upon every system boot. I can put a REG ADD command in a CMD file and have it run from HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run, but I was wondering if it's possible to avoid the CMD file and have the REG ADD command directly in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. I can't seem to find anything on this online.
UCyborg Posted October 31, 2020 Posted October 31, 2020 There's no issue adding it directly, eg.: reg.exe ADD "HKCU\Control Panel\Desktop" /v SCRNSAVE.EXE /d "whatever.scr" Putting this as the run entry works fine.
jaclaz Posted October 31, 2020 Posted October 31, 2020 Regedit (besides reg.exe) allows to merge a .reg file, i.e. REGEDIT [ /S ] addsome.REG Is that what you are asking? You can also have (alternatively) a ,cmd that embeds the .reg, see: https://www.robvanderwoude.com/regedit.php Conversely, if the .reg file extension is associated to regedit, "executing" the .reg file will merge its contents to Registry, but - since you don't have the /S parameter you will need to click on the confirmation popup. If the issue is with not showing the flashing CMD window when using a batch, you can use nircmd or any other among the various dediated toolsm or possibly also a .lnk file to run minimized. jaclaz
Tomcat76 Posted October 31, 2020 Author Posted October 31, 2020 @UCyborg Yup, it's working fine. This is what the exported .reg file looks like for the Ribbons screensaver (handy as a one-time activation on other PCs): Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] "ForceScreenSaver"="REG ADD \"HKCU\\Control Panel\\Desktop\" /f /v \"SCRNSAVE.EXE\" /t REG_SZ /d \"C:\\Windows\\system32\\Ribbons.scr\"" @jaclaz I wanted to avoid referencing an external file (.reg, .cmd, etc) in the Run command to keep it as simple as possible.
jaclaz Posted November 1, 2020 Posted November 1, 2020 13 hours ago, Tomcat76 said: @jaclaz I wanted to avoid referencing an external file (.reg, .cmd, etc) in the Run command to keep it as simple as possible. Yep , as often happen it depends on point of view, on what is "simple". I personally find it simpler to have a small .cmd/.bat like the self-contained batch, de gustibus .... jaclaz
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now