Sign in to follow this  
Followers 0
mbouchard

Enable Screensaver

4 posts in this topic

#1 ·  Posted (edited)

BAH, found my error, logon.scr not login.scr Missed it in a side by side comparison.

I am working on a script that will enable a screensaver yet am running into an issue were it is not turning on.

The code is going to be part of a larger script that will be used in a Kiosk we are setting up. The main script will depend on a screensaver being enabled to measure idle time, and will reset IE when the screensaver is turned off.

That being said, I want to make sure that a screensaver is in fact enabled and that it isn't password protected.

$strKeyPath = "HKCU\Control Panel\Desktop"

 ;Set value of ScreenSaveActive if not 1 (1=Active 0=inactive)
   If RegRead($strKeyPath, "ScreenSaveActive") <> 1 then
      RegWrite($strKeyPath, "ScreenSaveActive","Reg_SZ","1");
   EndIf

 ;Set value of ScreenSaveIsSecure if not 0 (1=Requires password 0=does not require password)
   If RegRead($strKeyPath, "ScreenSaveIsSecure") <> 0 then
      RegWrite($strKeyPath, "ScreenSaveIsSecure","Reg_SZ","0");
   EndIf

   $SSVal = RegRead($strKeyPath, "ScrnSave.exe");Check if ScrnSave.exe value is present.
   If @error = "-1" OR @error = "1" then
    ;If the value not present, set it to equal login.scr
      RegWrite($strKeyPath, "SCRNSAVE.EXE","Reg_SZ",@SystemDir & "\logon.scr");
    ;Reboot if key set.
;     Shutdown ( 0 ) 
   EndIf

For some reason, while it looks the same as if you enabled the screensaver using the Screen Saver tab in display properties, it isn't.

After running the above script, the SCRNSAVE.exe is present in the registry but not showing up in display properties, even after a reboot. I used InstallRite to check for changes between my script the the GUI interface and the only key that was changed was the SCRNSAVE.exe and they looked identical to me.

Does anyone have any ideas?

Thanks,

Mike

Edited by mbouchard

Share this post


Link to post
Share on other sites



BAH, found my error, logon.scr not login.scr Missed it in a side by side comparison.

I am working on a script that will enable a screensaver yet am running into an issue were it is not turning on.

The code is going to be part of a larger script that will be used in a Kiosk we are setting up. The main script will depend on a screensaver being enabled to measure idle time, and will reset IE when the screensaver is turned off.

That being said, I want to make sure that a screensaver is in fact enabled and that it isn't password protected.

$strKeyPath = "HKCU\Control Panel\Desktop"

;Set value of ScreenSaveActive if not 1 (1=Active 0=inactive)
   If RegRead($strKeyPath, "ScreenSaveActive") <> 1 then
      RegWrite($strKeyPath, "ScreenSaveActive","Reg_SZ","1");
   EndIf

;Set value of ScreenSaveIsSecure if not 0 (1=Requires password 0=does not require password)
   If RegRead($strKeyPath, "ScreenSaveIsSecure") <> 0 then
      RegWrite($strKeyPath, "ScreenSaveIsSecure","Reg_SZ","0");
   EndIf

   $SSVal = RegRead($strKeyPath, "ScrnSave.exe");Check if ScrnSave.exe value is present.
   If @error = "-1" OR @error = "1" then
   ;If the value not present, set it to equal login.scr
      RegWrite($strKeyPath, "SCRNSAVE.EXE","Reg_SZ",@SystemDir & "\logon.scr");
   ;Reboot if key set.
;     Shutdown ( 0 ) 
   EndIf

For some reason, while it looks the same as if you enabled the screensaver using the Screen Saver tab in display properties, it isn't.

After running the above script, the SCRNSAVE.exe is present in the registry but not showing up in display properties, even after a reboot. I used InstallRite to check for changes between my script the the GUI interface and the only key that was changed was the SCRNSAVE.exe and they looked identical to me.

Does anyone have any ideas?

Thanks,

Mike

"ScreenSaveIsSecure" <> "ScreenSaverIsSecure"

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

"ScreenSaveIsSecure" <> "ScreenSaverIsSecure"

Bah, thanks.

Share this post


Link to post
Share on other sites

Bah, thanks.

np glad i could help

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0