Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBS to set IE Home Pages

Status
Not open for further replies.

mdb22

Technical User
Jun 12, 2008
1
GB
I have used the following script to set the IE homepages. However, if i attempt to exceed more than 4 addresses, i get a syntax error.

Can anybody advise me on the followg script?:

Option Explicit

Dim arrValues

'Set your homepages here in the following array.
arrValues = Array(" _
" _
"
'declarations
Const HKEY_CURRENT_USER = &H80000001

Dim objRegistry
Dim strComputer, strKeyPath, strValueName

strComputer = "."

'get key object
Set objRegistry=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

'assign variables
strKeyPath = "Software\Microsoft\Internet Explorer\Main"
strValueName = "Secondary Start Pages" 'change this property only to keep Click as a home page

'set the property
objRegistry.SetMultiStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,arrValues
 
>However, if i attempt to exceed more than 4 addresses, i get a syntax error.
Since you said "syntax error", the only possibility I can conclude from the script is from your line defining arrValues. You must have forgotten a comma (,) and a line continutation (_) after the [ignore]"[/ignore]. For the moment, there is already a delinquent underscore after the closing parenthesis.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top