ScreenSaver Policies

G

Guest

I would like to require my users to have screensavers AND to have them
password protected. But I want them free to choose the screensaver and free
to set the timeout.

I have already learned how to do most of this using the registry key
(\HKCU\Software\Policies\Microsoft\Windows\ControlPanel\Desktop).
If I set an entry in there for ScreenSaverIsSecure = 1, then I get almost
all of what I want. But the user can defeat my design by selecting None as
the screensaver to be used.

Is there any way that I can remove or disable the "none" choice from the
screensaver list while otherwise allowing users to choose the screensaver and
timeout?

Thanks for your help.
Peter Smick
 
G

Guest

Try this, worked for me in similar situation, have adjusted to your
requirements, I think.

opt ('trayiconhide',1) ; Run as background process.

; Set to suit your requirements:
$DefSaver=@SystemDir & '\scrnsave.scr'
$MaxDelay=100

do

$HasSaver=1

$IsActive = RegRead('HKEY_CURRENT_USER\Control
Panel\Desktop','ScreenSaveActive')
$IsSecure = RegRead('HKEY_CURRENT_USER\Control
Panel\Desktop','ScreenSaverIsSecure')
$Timeout = RegRead('HKEY_CURRENT_USER\Control
Panel\Desktop','ScreenSaveTimeout')
$SaverFile = RegRead('HKEY_CURRENT_USER\Control
Panel\Desktop','SCRNSAVE.EXE')

if ($SaverFile="") OR (FileExists($SaverFile)=0) then
RegWrite ( 'HKEY_CURRENT_USER\Control Panel\Desktop', 'SCRNSAVE.EXE',
'REG_SZ', $DefSaver )
$HasSaver=0
endif

if $IsSecure = 0 then
RegWrite ( 'HKEY_CURRENT_USER\Control Panel\Desktop',
'ScreenSaverIsSecure', 'REG_SZ', 1 )
$HasSaver=0
endif

if $IsActive = 0 then
RegWrite ( 'HKEY_CURRENT_USER\Control Panel\Desktop', 'ScreenSaveActive',
'REG_SZ', 1 )
$HasSaver=0
endif

if $Timeout > $MaxDelay then
RegWrite ( 'HKEY_CURRENT_USER\Control Panel\Desktop',
'ScreenSaveTimeout', 'REG_SZ', $MaxDelay )
$HasSaver=0
endif

if $HasSaver=0 then
if @OSTYPE = 'WIN32_NT' then
Run(@SystemDir & "\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters")
endif
endif

sleep(10 * 60 * 1000) ; Check every 10min.

until 0; Stay resident

Compile with AutoIt 3.0 or higher from http://www.autoitscript.com

(Dont think this forum has a CODE option, so you might see a few wrapped
lines that will need rejoining. )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top