Sure, you can use the regread and regwrite methods:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthregread.asp


On 12/9/05, Harding, Devon <[EMAIL PROTECTED]> wrote:
> Well there must be some 'Check/Set' registry .vbs floating around.
> Shouldn't be that difficult should it?
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Paul Wilkinson
> Sent: Friday, December 09, 2005 1:19 PM
> To: [email protected]
> Subject: Re: [ActiveDir] Convert to .vbs
>
> That should be easy enough.
>
> I'd probably just create a reg with all of the registry settings you
> need, and just import the whole thing every time someone logs in.
> That might not be as efficient as doing checks to see if something
> exist first, and adding if it it doesn't, but updating a few keys like
> this can be done in no time and it's easy to update one reg file as
> needed.
>
> You need "reg.exe" which comes with WinXP and it's in the path.  If
> you have win2k, just copy reg.exe from XP to c:\winnt\system32.
> Also, I don't know where you put bginfo, but assuming it's somewhere
> in the path this will work.
>
> set oShell = WScript.CreateObject("WScript.Shell")
>
> oShell.run "reg.exe import \\server\share\usersettings.reg",0,False
> oShell.run "bginfo.exe /i\\bsgad1\netlogon\newbginfo.bgi
> /timer:0",0,False
>
> I don't think you need to log off the user in order to set the screen
> saver.  I'm pretty sure that takes effect when you change the reg
> keys.
>
>
>
>
>
>
> On 12/9/05, Harding, Devon <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > I need to convert this kix scrip into a smaller, faster .vbs script.
> Can it
> > be done?
> >
> >
> >
> > ; **** If workstation, exit script
> >
> > If @ProductType = "Windows 2000 Professional" or @ProductType =
> "Windows XP
> > Professional" or @ProductType = "Windows NT Workstation"
> >
> >             cls
> >
> >             Exit
> >
> > Endif
> >
> >
> >
> > ; **** Check / Set VNC application hooks for logon.scr screen saver
> >
> > $ReturnCode =
> > KeyExist("HKCU\Software\ORL\VNCHooks\Application_Prefs\logon.scr")
> >
> > If $ReturnCode=0
> >
> >
> > Addkey("HKCU\Software\ORL\VNCHooks\Application_Prefs\logon.scr")
> >
> >
> >
> WriteValue("HKCU\Software\ORL\VNCHooks\Application_Prefs\logon.scr","use
> _Deferral",1,"reg_dword")
> >
> >
> >
> WriteValue("HKCU\Software\ORL\VNCHooks\Application_Prefs\logon.scr","use
> _use_GetUpdateRect",1,"reg_dword")
> >
> >
> >
> WriteValue("HKCU\Software\ORL\VNCHooks\Application_Prefs\logon.scr","use
> _KeyPress",1,"reg_dword")
> >
> >
> >
> WriteValue("HKCU\Software\ORL\VNCHooks\Application_Prefs\logon.scr","use
> _LButtonUp",1,"reg_dword")
> >
> >
> >
> WriteValue("HKCU\Software\ORL\VNCHooks\Application_Prefs\logon.scr","use
> _MButtonUp",1,"reg_dword")
> >
> >
> >
> WriteValue("HKCU\Software\ORL\VNCHooks\Application_Prefs\logon.scr","use
> _RButtonUp",1,"reg_dword")
> >
> >
> >
> WriteValue("HKCU\Software\ORL\VNCHooks\Application_Prefs\logon.scr","use
> _Timer",0,"reg_dword")
> >
> > EndIf
> >
> >
> >
> >
> >
> > ; **** Check / Set registry settings for BGINFO
> >
> > $ReturnCode = KeyExist("HKCU\Software\Winternals")
> >
> > If $ReturnCode = 0
> >
> >             Addkey("HKCU\Software\Winternals")
> >
> > EndIf
> >
> >
> >
> > $ReturnCode = KeyExist("HKCU\Software\Winternals\BGInfo")
> >
> > If $ReturnCode = 0
> >
> >             Addkey("HKCU\Software\Winternals\BGInfo")
> >
> >
> >
> WriteValue("HKCU\Software\Winternals\BGInfo","Background",0,"reg_dword")
> >
> >
> >
> WriteValue("HKCU\Software\Winternals\BGInfo","Foreground",16777215,"reg_
> dword")
> >
> > EndIf
> >
> >
> >
> > ; **** Run BGINFO from NetLogon share
> >
> > Run @Ldrive + "\bginfo.exe
> > /i\\bsgad1\netlogon\newbginfo.bgi /timer:0"
> >
> >
> >
> >
> >
> > ; **** Check / Set registry settings for screen saver.  Logoff user if
> > settings are updated
> >
> > $IsLocked = ReadValue("HKCU\Control
> > Panel\Desktop","ScreenSaverIsSecure")
> >
> > $SSTimeOut = ReadValue("HKCU\Control
> > Panel\Desktop","ScreenSaveTimeout")
> >
> > $SSActive = ReadValue("HKCU\Control
> > Panel\Desktop","ScreenSaveActive")
> >
> > $ScrnSave = ReadValue("HKCU\Control Panel\Desktop","SCRNSAVE.EXE")
> >
> > If $IsLocked = 0 or (VAL($SSTimeOut) > 900) or $SSActive = 0 or
> $ScrnSave =
> > ""
> >
> >             WriteValue("HKCU\Control
> > Panel\Desktop","ScreenSaverIsSecure","1","reg_sz")
> >
> >             WriteValue("HKCU\Control
> > Panel\Desktop","ScreenSaveActive","1","reg_sz")
> >
> >             WriteValue("HKCU\Control
> > Panel\Desktop","ScreenSaveTimeout","900","reg_sz")
> >
> >             WriteValue("HKCU\Control
> Panel\Desktop","SCRNSAVE.EXE","%system
> > root%\system32\logon.scr","reg_sz")
> >
> >             MessageBox("ScreenSaver settings were not previously set.
> > Settings have been updated.  A logout is required to activate new
> settings.
> > Click Ok and the system will logout you out now.  Auto-logoff in 20
> > seconds.","Logout Required",4112,20)
> >
> >             Logoff(1)
> >
> > EndIf
> >
> >
> >
> >
> >
> > Devon Harding
> >
> > Windows Systems Engineer
> >
> > Southern Wine & Spirits - BSG
> >
> > 954-602-2469
> >
> >
> >
> > ________________________________
> >
> >
> >
> >
> >  __________________________________
> > This message and any attachments are solely for the intended recipient
> > and may contain confidential or privileged information. If you are not
> > the intended recipient, any disclosure, copying, use or distribution
> of
> > the information included in the message and any attachments is
> > prohibited. If you have received this communication in error, please
> > notify us by reply e-mail and immediately and permanently delete this
> > message and any attachments. Thank You.
>
>
> --
> Paul Wilkinson
> [EMAIL PROTECTED]
> List info   : http://www.activedir.org/List.aspx
> List FAQ    : http://www.activedir.org/ListFAQ.aspx
> List archive:
> http://www.mail-archive.com/activedir%40mail.activedir.org/
> List info   : http://www.activedir.org/List.aspx
> List FAQ    : http://www.activedir.org/ListFAQ.aspx
> List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
>


--
Paul Wilkinson
[EMAIL PROTECTED]
List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to