Page 1 of 1 1
Topic Options
#52008 - 2000-10-30 09:48 PM Need to Automate a Locking Screen Saver
Anonymous
Unregistered


Hello,
I need to be able to set a "locking screen saver" for all users on my network. I have copied a couple of scripts that I found but have had no luck with them. I can get the screen saver selected, but it's not activated. Here is the script that I have been using:

? "Checking state of Desktop"
ExistKey ("HKEY_CURRENT_USER\Control Panel\Desktop")
If @ERROR = 0
; ? 'Sanity Check, Desktop Key exists"

? "Reading screen saver values"
$SSact =Readvalue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveActive")
$SSsec =Readvalue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaverIsSecure")
$SStim =Readvalue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveTimeOut")
$SSexe =Readvalue("HKEY_CURRENT_USER\Control Panel\Desktop","ScrnSave.Exe")

; ? "SSact (REG_SZ) has a value of $ssact (should be 1) "
; ? "SSsec (REG_SZ) has a value of $sssec (should be 1) "
; ? "SStim (REG_SZ) has a value of $sstim (should be 180) "
; ? "SSexe (REG_SZ) has a value of $ssexe (should be logon.scr) "
; ? " "
; ? "Updating Screen saver active flag"
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveActive","1","REG_SZ")
If @ERROR = 0
; ? "Screen Saver Active updated"
else
; ? "Screen Saver Active not updated"
endif

; ? "Updating Screen saver secure flag"
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaverIsSecure","1","REG_SZ")
If @ERROR = 0
; ? "Screen Saver Secure updated"
else
; ? "Screen Saver Secure not updated"
endif

; ? "Updating Screen saver timeout flag"
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","ScreenSaveTimeOut","180","REG_SZ")
If @ERROR = 0
; ? "Scrren Saver Timeout updated"
else
; ? "Screen Saver Timeout not updated"
endif

; ? "Updating Screen saver image flag"
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop","SCRNSAVE.EXE","LOGON.SCR","REG_SZ")
If @ERROR = 0
; ? "Screen Saver Image updated"
else
; ? "Screen Saver Image not updated"
endif

else
; ? "Sanity Check, Desktop screensaver key not found"
endif


Top
#52009 - 2000-11-01 04:34 AM Re: Need to Automate a Locking Screen Saver
Anonymous
Unregistered


Hi,

In your WriteValue command for setting the screen saver, instead of just saying "LOGON.SCR", try putting the whole path "C:\WINNT\SYSTEM32\LOGON.SCR" or "%WINDIR%\System32\Logon.scr".

Good luck.

Roneil Icatar

Top
#52010 - 2000-11-09 03:14 PM Re: Need to Automate a Locking Screen Saver
Anonymous
Unregistered


Here is a piece of my script, it still needs some changing so the active desktop is disabeled but sofar it works;


if @RAS
messagebox("Instellingen worden niet aangepast ivm RAS","",64)
else
?"burobladinstellingen controleren"

$SSactive=ReadValue("HKEY_CURRENT_USER\Control Panel\Desktop\","ScreenSaveActive")
if @Error <> 0 messagebox(" $SSactive @Error, bel automatisering","",64) endif

$Bckgrnd=ReadValue("HKEY_CURRENT_USER\Control Panel\Desktop\","Wallpaper")
if @Error <> 0 messagebox(" $Bckgrnd @Error, bel automatisering","",64) endif

$Tile=ReadValue("HKEY_CURRENT_USER\Control Panel\Desktop\","Tilewallpaper")
if @Error <> 0 messagebox(" $Tile @Error, bel automatisering","",64) endif

if $os="Win98"
$Color=ReadValue("HKEY_CURRENT_USER\Control Panel\Colors\","Background")
if @Error <> 0
messagebox(" $Color @Error, bel automatisering","",64)
endif
else
$Color <> "255 255 255"
messagebox("Uw heeft nog geen windows 98 !!","",64)
endif

$SSaver = ReadProfileString("System.ini", "boot", "SCRNSAVE.EXE")
if @Error <> 0 messagebox(" $SSaver @Error, bel automatisering","",64) endif


if $Bckgrnd <> "C:\WINDOWS\LogoEB.bmp" or $Tile <> "0" or $Color <> "255 255 255" or $SSactive = 0 or $SSaver <> "C:\WINDOWS\SYSTEM\3DTEKS~1.SCR"

?"burobladinstellingen worden aangepast"
; set wallpaper
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop\","Wallpaper","C:\WINDOWS\LogoEB.bmp","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General\","Wallpaper"," ","REG_SZ")
WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General\","BackupWallpaper"," ","REG_SZ")
; set tile wallpaper ( centreren, spreiden of naast elkaar )
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop\","Tilewallpaper","0","REG_SZ")
; set backgroundcolor to white
WriteValue("HKEY_CURRENT_USER\Control Panel\Colors\","Background","255 255 255","REG_SZ")
; activate screensaver
WriteValue("HKEY_CURRENT_USER\Control Panel\Desktop\","ScreenSaveActive","1","REG_SZ")
; set screensaver
WriteProfileString("System.ini", "boot", "SCRNSAVE.EXE", "C:\WINDOWS\SYSTEM\3DTEKS~1.SCR")
WriteProfileString("Control.ini", "Screen Saver.3DText", "DemoType", "0")
WriteProfileString("Control.ini", "Screen Saver.3DText", "Rotstyle", "3")
WriteProfileString("Control.ini", "Screen Saver.3DText", "Mozaïek", "7")
WriteProfileString("Control.ini", "Screen Saver.3DText", "Formaat", "69")
WriteProfileString("Control.ini", "Screen Saver.3DText", "Speed", "24")
WriteProfileString("Control.ini", "Screen Saver.3DText", "SurfStyle", "0")
WriteProfileString("Control.ini", "Screen Saver.3DText", "Font", "Arial")
WriteProfileString("Control.ini", "Screen Saver.3DText", "FontAttributes", "0")
WriteProfileString("Control.ini", "Screen Saver.3DText", "CharSet", "1")
WriteProfileString("Control.ini", "Screen Saver.3DText", "Text", @FULLNAME)
WriteProfileString("Control.ini", "Screen Saver.3DText", "Patroon", " ")
WriteProfileString("Control.ini", "Screen Saver.3DText", "TextureFileOffset", "0")
; set companyname for internet explorer
WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\main\","Window Title", $title ,"REG_SZ")
; Don't alow active desktop
; ****** EC NOG AANPASSEN !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

messagebox("Uw instellingen zijn aangepast!","",64)

if $os="Win98" SHELL "%windir%\RUNDLL32.EXE Shell32.dll,SHExitWindowsEx 6" endif
if $os="Win95" SHELL "%windir%\RUNDLL32.EXE user.exe,ExitWindows" endif
sleep 600
endif

Top
#52011 - 2000-11-12 06:30 PM Re: Need to Automate a Locking Screen Saver
Anonymous
Unregistered


I know this can be done with Kixtart (is there anything that cannot be done with Kixtart), but it's much easier to do this with a policy.
You can force every user on your network to use a certain screensaver, password protection and a time-out of let's say 7 minutes.

Top
#52012 - 2000-11-13 06:39 AM Re: Need to Automate a Locking Screen Saver
Anonymous
Unregistered


Hello :-)!

Here's a script I use to implement screen savers through system policy.

Save the script to an *.ADM file on the servers c:\winnt\inf directory and add the template to your policy using system policy editor.

code:
CATEGORY !!Any_Name

CATEGORY !!Screen_Saver_Policy
POLICY !!Screen_Saver
KEYNAME "Control Panel\Desktop"
PART !!Screen_Saver_Location EDITTEXT
DEFAULT !!DEF_SCREEN_SAVER
VALUENAME SCRNSAVE.EXE
END PART
END POLICY
POLICY !!ENABLE_SCREEN_SAVER
KEYNAME "Control Panel\Desktop"
VALUENAME ScreenSaveActive
VALUEON "1" VALUEOFF "0"
END POLICY
POLICY !!ENABLE_Password
KEYNAME "Control Panel\Desktop"
VALUENAME ScreenSaverIsSecure
VALUEON "1" VALUEOFF "0"
END POLICY
POLICY !!SCREEN_SAVER_IDLE_TIMEOUT
KEYNAME "Control Panel\Desktop"
PART !!Timeout_Time EDITTEXT
VALUENAME ScreenSaveTimeout
END PART
END POLICY
END CATEGORY
END CATEGORY

[strings]
AnyName="AnyName"
Screen_Saver_Policy="Screen Saver Policies"
Screen_Saver="Screen Saver"
ENABLE_SCREEN_SAVER="Enable Screen Saver"
Screen_Saver_Location="Enter the location of the Screen Saver"
DEF_Screen_Saver="%SYSTEMROOT%\system32\logon.scr"
ENABLE_Password=Enable Password
SCREEN_SAVER_IDLE_TIMEOUT="Screen Saver Activation Timeout"
Timeout_Time="Number of seconds before Screensaver Activates"



[This message has been edited by M7364 (edited 13 November 2000).]

Top
#52013 - 2000-11-13 09:17 AM Re: Need to Automate a Locking Screen Saver
Anonymous
Unregistered


That's a good start.
I'm right now working on an .adm file that can configure every screensaver that's standard with Windows NT 4.0.
It should be ready somewhere in December. If anybody is interested, let me know, I'll post the URL when I'm ready....


Top
#52014 - 2000-11-13 10:19 AM Re: Need to Automate a Locking Screen Saver
Anonymous
Unregistered


That's great!
I also have some policy scripts for IE proxy settings and hiding drives. Please advise if it will be a help to your compilation.
Good Luck !

Top
#52015 - 2000-11-15 06:05 PM Re: Need to Automate a Locking Screen Saver
Anonymous
Unregistered


Thanks for the reply.
This script is very similar to the one I tried using prior to experimenting with Kixstart. I tried using your .adm file but it does not work on my network. I use roaming profiles here and it seems that the screen saver settings follow the profile. The policy file is not is not enforced.
Any ideas?

Top
#52016 - 2000-11-15 08:17 PM Re: Need to Automate a Locking Screen Saver
rick_coughlin Offline
Fresh Scripter

Registered: 2000-11-15
Posts: 7
Loc: Gaithersburg, MD, USA
Here is what I use in my script. Sets the screen saver to the Blank screen and times out at 7 minutes. Mind you that I have NT 4.0 workstations.


code:
; ----------------------------------------------------------------------- ;
; Set the Screen Saver to BLANK and the timeout to 7 minutes. ;
; ----------------------------------------------------------------------- ;

WRITEVALUE ("Control Panel\Desktop", "ScreenSaveActive", "1", "REG_SZ")
WRITEVALUE ("Control Panel\Desktop", "ScreenSaverIsSecure", "1", "REG_SZ")
WRITEVALUE ("Control Panel\Desktop", "ScreenSaveTimeOut", "420", "REG_SZ")
WRITEVALUE ("Control Panel\Desktop", "SCRNSAVE.EXE", "C:\WINNT\black16.scr", "REG_SZ")




Top
#52017 - 2000-11-15 10:32 PM Re: Need to Automate a Locking Screen Saver
Anonymous
Unregistered


Success at last!! Thanks for all of the responses. What finally worked was using a custom .adm file, but instead of saving it into a new .adm file I edited the existing winnt.adm file with the new entries.
Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.137 seconds in which 0.115 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org