OregonSteve
MIS
Greetings-
We have a logoff script which checks for a screensaver and if the workstation doesn't have one it will set it to a default. It will also set the time for the screensave to kick in to 10 minutes if it's anything higher than that.
One PC, a Toshiba Satellite laptop, gets an error when processing the script: Line 12 Character 4
Here is the script:
********************
main
sub main
const HKEY_CURRENT_USER = &H80000001
const strKeyPath = "Control Panel\Desktop"
const strSaver = "SCRNSAVE.EXE"
const strTimeout = "ScreenSaveTimeOut"
const intTargetTimeout = 600
const strTargetSaver = "C:\WINDOWS\System32\logon.scr"
const strComputer = "."
Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strSaver,strValueSaver
oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strTimeout,strValueTimeout
'WScript.Echo strValueSaver & ":" & strValueTimeout
intValueTimeout = CInt(strValueTimeout)
if Len(strValueSaver) > 0 then
else
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strSaver,strTargetSaver
end if
if intValueTimeout > intTargetTimeout or intValueTimeout <= 0 then
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strTimeout,intTargetTimeout
end if
end sub
*****************************
Here is line 12: Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
Thanx
OregonSteve
"..You should never, never doubt what nobody is sure about." -Willy Wonka
We have a logoff script which checks for a screensaver and if the workstation doesn't have one it will set it to a default. It will also set the time for the screensave to kick in to 10 minutes if it's anything higher than that.
One PC, a Toshiba Satellite laptop, gets an error when processing the script: Line 12 Character 4
Here is the script:
********************
main
sub main
const HKEY_CURRENT_USER = &H80000001
const strKeyPath = "Control Panel\Desktop"
const strSaver = "SCRNSAVE.EXE"
const strTimeout = "ScreenSaveTimeOut"
const intTargetTimeout = 600
const strTargetSaver = "C:\WINDOWS\System32\logon.scr"
const strComputer = "."
Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strSaver,strValueSaver
oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strTimeout,strValueTimeout
'WScript.Echo strValueSaver & ":" & strValueTimeout
intValueTimeout = CInt(strValueTimeout)
if Len(strValueSaver) > 0 then
else
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strSaver,strTargetSaver
end if
if intValueTimeout > intTargetTimeout or intValueTimeout <= 0 then
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strTimeout,intTargetTimeout
end if
end sub
*****************************
Here is line 12: Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
Thanx
OregonSteve
"..You should never, never doubt what nobody is sure about." -Willy Wonka