|
Got it, I had to add the WshShell in front
of RegRead Thanks, Brian ' Check / Set registry settings for screen
saver. Logoff user if settings are updated Dim isLocked, ssTimeout, ssActive,
ScrnSave, WshShell Const EWX_LOGOFF = 0 Set WshShell =
WScript.CreateObject("WScript.Shell") Set wmi =
GetObject("winmgmts:{(Shutdown)}") Set objSet =
wmi.InstancesOf("Win32_OperatingSystem") isLocked = WshShell.RegRead
("HKCU\Control Panel\Desktop\ScreenSaverIsSecure") ssTimeout = WshShell.RegRead
("HKCU\Control Panel\Desktop\ScreenSaveTimeout") ssActive = WshShell.RegRead
("HKCU\Control Panel\Desktop\ScreenSaveActive") ScrnSave = WshShell.RegRead
("HKCU\Control Panel\Desktop\SCRNSAVE.EXE") If (isLocked = 0) or (CInt(ssTimeout)
>900) Or (ssActive = 0) Or (ScrnSave = "") Then WshShell.RegWrite "HKCU\Control
Panel\Desktop\ScreenSaverIsSecure",1,"REG_SZ" WshShell.RegWrite
"HKCU\Control Panel\Desktop\ScreenSaveActive",1,"REG_SZ" WshShell.RegWrite
"HKCU\Control Panel\Desktop\ScreenSaveTimeout",900,"REG_SZ" WshShell.RegWrite
"HKCU\Control Panel\Desktop\SCRNSAVE.EXE","%system
root%\system32\logon.scr","REG_SZ" WScript.Echo "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." For Each obj in objSet Set os = obj Exit For Next os.Win32Shutdown EWX_LOGOFF End If From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Desmond Dim isLocked isLocked = RegRead(“Stuff”) Dim ssTimeout ssTimeout = RegRead(“MoreStuff”) If (isLocked = 0) or (CInt(ssTimeout) >900)
Then ‘ Do Stuff End If This helps? From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of This is the last step in my Kix to
.vbs conversion. Having a little difficulty with ‘OR’
statements in conversion. Here is the original kix script: ' 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 Windows
Systems Engineer Southern
Wine & Spirits - BSG 954-602-2469 __________________________________ |
- RE: [ActiveDir] If, and, or in .vbs Harding, Devon
- RE: [ActiveDir] If, and, or in .vbs Harding, Devon
