An annoyance I have with my workplace-provided laptop is that periodically updates are pushed to it by the IT department. This resets the screen saver settings to I have to login again anytime I am away from my machine for more than a pretty short period of time. While this may be desired behavior in a general case, since I am in an already secure area I don't need to have my machine log me out in this way.
The address the problem, here are two batch scripts. These must be run as administrator. To use, open a Command Prompt and use the right-click context menu to "Run as administrator". Once you have changed to the directory where these two scripts are located, run them as you would any other batch command. Of course, feel free to edit them to your liking. I have tested them on my system only and they work fine. Use at your own risk, blah blah blah, yadda yadda.
The address the problem, here are two batch scripts. These must be run as administrator. To use, open a Command Prompt and use the right-click context menu to "Run as administrator". Once you have changed to the directory where these two scripts are located, run them as you would any other batch command. Of course, feel free to edit them to your liking. I have tested them on my system only and they work fine. Use at your own risk, blah blah blah, yadda yadda.
listscreensaver.bat
REM
REM Script to list current screen saver settings
REM
@echo off
reg query "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOut
reg query "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveActive
reg query "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaverIsSecure
reg query "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveTimeOut
reg query "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveActive
reg query "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaverIsSecure
pause
REM Script to list current screen saver settings
REM
@echo off
reg query "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOut
reg query "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveActive
reg query "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaverIsSecure
reg query "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveTimeOut
reg query "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveActive
reg query "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaverIsSecure
pause
listscreensaver.bat |
screensaver.bat
REM
REM Script to automate setting of screen saver timeout,
REM whether or not it is active and whether or not you
REM have to login again when screen saver is active.
REM
REM Use with caution as this will directly change registry values.
REM
@echo off
SET timeout=0
SET active=0
SET secure=0
net session >nul 2>&1
if %errorLevel% == 0 (
echo Running as Administrator
) else (
echo Running as %USERNAME%
)
echo Setting ScreenSaveTimeOut to %timeout%
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOut /d %timeout% /f
echo Setting ScreenSaveActive to %active%
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveActive /d %active% /f
echo Setting ScreenSaverIsSecure to %secure%
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaverIsSecure /d %secure% /f
echo Setting Group Permissions screen saver parameters to %timeout%, %active%, %secure%
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveTimeOut /d %timeout% /f
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveActive /d %active% /f
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaverIsSecure /d %secure% /f
echo Updating user parameters
rundll32.exe user32.dll, UpdatePerUserSystemParameters
pause
REM Script to automate setting of screen saver timeout,
REM whether or not it is active and whether or not you
REM have to login again when screen saver is active.
REM
REM Use with caution as this will directly change registry values.
REM
@echo off
SET timeout=0
SET active=0
SET secure=0
net session >nul 2>&1
if %errorLevel% == 0 (
echo Running as Administrator
) else (
echo Running as %USERNAME%
)
echo Setting ScreenSaveTimeOut to %timeout%
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOut /d %timeout% /f
echo Setting ScreenSaveActive to %active%
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveActive /d %active% /f
echo Setting ScreenSaverIsSecure to %secure%
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaverIsSecure /d %secure% /f
echo Setting Group Permissions screen saver parameters to %timeout%, %active%, %secure%
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveTimeOut /d %timeout% /f
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaveActive /d %active% /f
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop" /v ScreenSaverIsSecure /d %secure% /f
echo Updating user parameters
rundll32.exe user32.dll, UpdatePerUserSystemParameters
pause
screensaver.bat |