Andrew Parker
asked on
vbs error with IE startup script on new laptop
Hi all
A few experts helped me a while back to create the code below to open a number of IE sites when my pc starts up. I have just moved to a new laptop but on startup with the same files it comes up with a VB error
script: C:\documents and settings\parker_a\desktop\ Startup Files\ IE Startup1.vbs
Line 17
Char 27
Error Expected end of statement
Code 800A0401
Source Microsoft VBScript compilation error.
This worked fine on my old PC no real change in spec, any ideas?
A few experts helped me a while back to create the code below to open a number of IE sites when my pc starts up. I have just moved to a new laptop but on startup with the same files it comes up with a VB error
script: C:\documents and settings\parker_a\desktop\
Line 17
Char 27
Error Expected end of statement
Code 800A0401
Source Microsoft VBScript compilation error.
This worked fine on my old PC no real change in spec, any ideas?
Const navOpenInBackgroundTab = &H1000&
strSite1 = "http://bdi/Admin/ChangeManagement/Default.asp?Order=RefID&Status=All"
strSite2 = "http://bdi3/sites/ict/projects/Lists/Project%20Reporting/Project%20Reporting.aspx"
strSite3 = "http://bdi3/Library/Pages/Systems%20Event%20Planner.aspx"
strSite4 = "http://www.google.co.uk/"
strSite5 = "http://www.experts-exchange.com/"
strSite6 = "http://www.bbc.com"
strSite7 = "http://bdi3/Pages/Default.aspx"
strSite8 = "http://prd-infra/infralive/infraEnterprise8.htm"
strSite9 = "http://prd-ap201-vm/acweb/login.aspx"
Set objIE = WScript.CreateObject("InternetExplorer.Application")
objIE.Location = New Point(100, 100)
objIE.Navigate2 strSite1
objIE.Navigate2 strSite2, navOpenInBackgroundTab
objIE.Navigate2 strSite3, navOpenInBackgroundTab
objIE.Navigate2 strSite9, navOpenInBackgroundTab
objIE.Navigate2 strSite8, navOpenInBackgroundTab
objIE.Navigate2 strSite10, navOpenInBackgroundTab
objIE.Visible = True
Set objIE = WScript.CreateObject("InternetExplorer.Application")
objIE.Navigate2 strSite7
objIE.Navigate2 strSite4, navOpenInBackgroundTab
objIE.Navigate2 strSite5, navOpenInBackgroundTab
objIE.Visible = True
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Stupid question mark, but how would I run the javascript as at the moment ive got a vbs file.
@mero, that works cool, but it seems to add an extra tab at the start that doesnt connect to anything? strange :)
@mero, that works cool, but it seems to add an extra tab at the start that doesnt connect to anything? strange :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ive got it mero, had to take the ,CLng(navOpenInNewTab) off the first IEobject :)
@Andrewajp002 ... not a stupid question at all!
Just paste the JavaScript code into a standard text file, just as with VBS. Only rename the extension to .js instead of .vbs. Use cscript, wscript, or an old-fashioned double-click from within the GUI to have Windows Scripting Host compile and launch. Voila!
Just paste the JavaScript code into a standard text file, just as with VBS. Only rename the extension to .js instead of .vbs. Use cscript, wscript, or an old-fashioned double-click from within the GUI to have Windows Scripting Host compile and launch. Voila!
ASKER
Hi Mark, not sure why but its coming up with a few errors, Meros one works perfectly, if its ok with mero I will split the points 80/20?
do it as you like. Your question - Your decision!
I've no problem with point split, as mark delivered another solution
I've no problem with point split, as mark delivered another solution
The above listed code seems to be written for visual basic (vb) and not vbs.
Also there are problems with the spaces in the URL (%20), which are causing strange errors. Please no not use the %20 in the script
Open in new window