Click here to Skip to main content
12,947,379 members (49,575 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
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
					'Creating DisableToolbars and Setting value
					dwValue17b = 1
					oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
				End If
			Next
		Else
		   'Create PrivacIE Key
		   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
					'Creating DisableToolbars and Setting value
					dwValue17b = 1
					oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath17b,"DisableToolbars",dwValue17b
				End If
			Next
		End If
	Else 
		'Create Safety Key
		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
					'Creating DisableToolbars and Setting value
					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
Posted 8-Feb-13 5:50am
namerg417
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

If in doubt, Google the error message!
It would have taken you straight here: What do you mean "cannot use parentheses?"[^] - it explains the cause and the solution.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

These will cause errors:
oReg.CreateKey(HKEY_CURRENT_USER,strKeyPath17a)
wscript.sleep (1000)
oReg.CreateKey(HKEY_CURRENT_USER,strKeyPath17b)

Should be:

oReg.CreateKey HKEY_CURRENT_USER,strKeyPath17a
wscript.sleep 1000
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath17b
  Permalink  
Comments
Sergey Alexandrovich Kryukov 22-Feb-13 18:23pm
   
Please don't post such content as "answer" — it is not.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,059
CHill60 3,235
Maciej Los 2,538
Jochen Arndt 1,935
ppolymorphe 1,795


Advertise | Privacy | Mobile
Web02 | 2.8.170518.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100