Hello I have the following code but is giving me the error mentioned in the subject and I cant figure it out where is it. Thanks for your help.
wscript.echo ""
strKeyPath17 = "Software\Microsoft\Internet Explorer"
strKeyPath17a = "Software\Microsoft\Internet Explorer\Safety"
strKeyPath17b = "Software\Microsoft\Internet Explorer\Safety\PrivacIE"
oReg.EnumKey HKEY_CURRENT_USER,strKeyPath17,arrValueKeys
For Each strValueKey In arrValueKeys
SafetyNameExists = (StrComp(strValueKey,"Safety"))
If SafetyNameExists = 0 Then
oReg.EnumKey HKEY_CURRENT_USER,strKeyPath17a,arrValueKeys
PrivacIENameExists = (StrComp(strValueKey,"PrivacIE"))
If PrivacIENameExists = 0 Then
oReg.EnumValues HKEY_CURRENT_USER,strKeyPath17b,arrValueNames
For Each strValueName In arrValueNames
DisableToolBars_NameExists = (StrComp(strValueName,"DisableToolbars"))
If DisableToolBars__NameExists = 0 Then
FlagDisableToolBars_NameExists = 1
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
If dwValue17b = 0 OR dwValue17b = 1 Then
If dwValue17b = 0 Then
Wscript.Echo "Current DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Unchecked"
End If
If dwValue17b = 1 Then
Wscript.Echo "Current DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Checked"
End If
Else
Wscript.Echo "Current DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Unchecked"
dwValue17b = 1
Wscript.Echo "Setting the right GE Recommendation"
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
Wscript.Echo "DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Value Set. You have 10 seconds to verify registry change"
wscript.sleep (10000)
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath16,"1409",dwValue16
Wscript.Echo "New DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Checked"
End If
Else
dwValue17b = 1
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
End If
Next
Else
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath17b
oReg.EnumValues HKEY_CURRENT_USER,strKeyPath17b,arrValueNames
For Each strValueName In arrValueNames
DisableToolBars_NameExists = (StrComp(strValueName,"DisableToolbars"))
If DisableToolBars__NameExists = 0 Then
FlagDisableToolBars_NameExists = 1
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
If dwValue17b = 0 OR dwValue17b = 1 Then
If dwValue17b = 0 Then
Wscript.Echo "Current DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Unchecked"
End If
If dwValue17b = 1 Then
Wscript.Echo "Current DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Checked"
End If
Else
Wscript.Echo "Current DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Unchecked"
dwValue17b = 1
Wscript.Echo "Setting the right GE Recommendation"
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
Wscript.Echo "DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Value Set. You have 10 seconds to verify registry change"
wscript.sleep (10000)
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath16,"1409",dwValue16
Wscript.Echo "New DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Checked"
End If
Else
dwValue17b = 1
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
End If
Next
End If
Else
oReg.CreateKey(HKEY_CURRENT_USER,strKeyPath17a)
wscript.sleep (1000)
oReg.CreateKey(HKEY_CURRENT_USER,strKeyPath17b)
oReg.EnumValues HKEY_CURRENT_USER,strKeyPath17b,arrValueNames
For Each strValueName In arrValueNames
DisableToolBars_NameExists = (StrComp(strValueName,"DisableToolbars"))
If DisableToolBars__NameExists = 0 Then
FlagDisableToolBars_NameExists = 1
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
If dwValue17b = 0 OR dwValue17b = 1 Then
If dwValue17b = 0 Then
Wscript.Echo "Current DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Unchecked"
End If
If dwValue17b = 1 Then
Wscript.Echo "Current DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Checked"
End If
Else
Wscript.Echo "Current DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Unchecked"
dwValue17b = 1
Wscript.Echo "Setting the right GE Recommendation"
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
Wscript.Echo "DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Value Set. You have 10 seconds to verify registry change"
wscript.sleep (10000)
oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath16,"1409",dwValue16
Wscript.Echo "New DISABLE TOOLBARS AND EXTENSIONS WHEN INPRIVATE BROWSING STARTS Status: " & dwValue17b & " Checked"
End If
Else
dwValue17b = 1
oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
End If
Next
End If
Next
Error:
C:\scripts\FindRegEntry.vbs(453, 50) Microsoft VBScript compilation error: Cannot use parentheses when calling a Sub