Setting Windows 7 Screensaver from Command Line

2

1

I'm trying to deploy a photo screensaver to several Windows 7 machines. Due to some unique restraints, I can only do it from a .bat file (no group policy). I have come up with this script:

@echo off
mkdir "c:\photos"
copy *.jpg "c:\photos"
reg delete "HKCU\Software\Microsoft\Windows Photo Viewer\Slideshow\Screensaver" /v EncryptedPIDL /f
reg add    "HKCU\Software\Microsoft\Windows Photo Viewer\Slideshow\Screensaver" /v EncryptedPIDL /t REG_SZ /d "FAAfUOBP0CDqOmkQotgIACswMJ0ZAC9DOlwAAAAAAAAAAAAAAAAAAAAAAAAAUAAxAAAAAAAdQ+ByEABwaG90b3MAADoACAAEAO++HUPNch1D4HIqAAAAF78BAAAAEAAAAAAAAAAAAAAAAAAAAHAAaABvAHQAbwBzAAAAFgAAAA==" /f
reg delete "HKCU\Control Panel\Desktop" /v SCRNSAVE.EXE /f
reg add    "HKCU\Control Panel\Desktop" /v SCRNSAVE.EXE /t REG_SZ /d  C:Windows\System32\PhotoScreenSaver.scr /f
reg delete "HKCU\Control Panel\Desktop" /v ScreenSaveTimeOut /f
reg add    "HKCU\Control Panel\Desktop" /v ScreenSaveTimeOut /t REG_SZ /d 60 /f
reg delete "HKCU\Control Panel\Desktop" /v ScreenSaverIsSecure /f
reg add    "HKCU\Control Panel\Desktop" /v ScreenSaverIsSecure /t REG_SZ /d 1 /f
reg delete "HKCU\Control Panel\Desktop" /v ScreenSaveActive /f
reg add    "HKCU\Control Panel\Desktop" /v ScreenSaveActive /t REG_SZ /d 1 /f
rundll32.exe user32.dll, UpdatePerUserSystemParameters

which is being run "as an administrator". The correct screen saver settings show up in the control panel dialog box, but the machines just go to the lock screen (and don't show the screen saver) when the timeout is reached. Is there another setting I'm missing? Can anyone help out, I've been struggling with this and can't make any headway. Thanks

David Alvares

Posted 2013-08-29T15:33:44.567

Reputation: 39

Where do you plan to deploy this? – krowe – 2013-08-29T15:39:56.593

It's a rather unique setup of machines that are effectively reloaded with a new windows image over the network on every reboot. They run a customization script on boot that sets up some necessary things. This setup was chosen so that students can do whatever they like with the machines (be admin tinker) and they are clean after reboot (not ideal, but it works). – David Alvares – 2013-08-29T15:53:56.503

Have you tried logging out and in again? – Scott – 2013-08-30T02:09:21.027

I have tried logout/login and it does not work, sadly. If I go to the screen saver dialog and change it to none and then back to photos it works, though. – David Alvares – 2013-08-30T20:37:18.327

Answers

1

Accidentally wrote:

C:Windows\System32\PhotoScreenSaver.scr

instead of:

C:\Windows\System32\PhotoScreenSaver.scr

Somehow, Windows still chose the correct screensaver in the properties dialog, but wouldn't actually work. It also added another entry called PPhotos?? My mistake just manifested very strangely.

David Alvares

Posted 2013-08-29T15:33:44.567

Reputation: 39