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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE Explorer issue.

Status
Not open for further replies.

sparkbyte

Technical User
Sep 20, 2002
879
US
I have a script which launches IE and navigates to a specific web page.

My issue is this...

If I launch IE like this...
The page errors out and won't launch the page.
It might work at best 1/3 the time. Always fails the first time a user logs on. In which the script will perform a TS install of the client software before launching IE.

Code:
'			 Run Core Browser
			Set objIE=WScript.createobject("internetexplorer.application","objIE")
			objIE.visible = True
			objIE.AddressBar = True 
			objIE.StatusBar = False
			objIE.MenuBar = True
			objIE.FullScreen = False 
			URL = "//" & UserComputer & "/CoreDirector_" & strCoreServerVersion &_
			"/login.aspx?BK=" & strBank
			objIE.Navigate(URL)
			WScript.Sleep(500)

But if I launch IE this way...
it works every time. But I loose the control the first example allows.

Code:
             If strCounter > 0 Then
'                 WScript.Echo "User is member of multiple banks"
                 Exit For ' Causes For...Next loop to end
             Else
                 strCounter = strCounter + 1 ' Increment counter for next loop
             End If

			sExePath = "C:\PROGRA~1\INTERN~1\iexplore.exe"

			'  Set switch for silent installation of workstation client.
			sSwitches = "-new [URL unfurl="true"]http://"[/URL] & UserComputer & _
			"/CoreDirector_" & strCoreServerVersion & "/login.aspx?BK=" & strBank

'			WScript.Echo Chr(34) & sExePath & Chr(34) & " " & sSwitches & ", 3, False" 

			If objFSO.FileExists(sExePath) Then
				objShell.Run Chr(34) & sExePath & Chr(34) & " " & sSwitches, 3, False 
			Else 
			End If

Any ideas why one way works but the other doesn't???

Thanks

John Fuhrman
Titan Global Services
 
What if you tried this?

Code:
Set objIE = Createobject("internetexplorer.application")
objIE.visible = True
objIE.AddressBar = True
objIE.StatusBar = False
objIE.MenuBar = True
objIE.FullScreen = False
objIE.Navigate "about:blank"
URL = "//" & UserComputer & "/CoreDirector_" & strCoreServerVersion &_
"/login.aspx?BK=" & strBank
Do Until objIE.ReadyState = 4
	WScript.Sleep 1000
Loop 
objIE.Navigate(URL)

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Darn that was simple.. That did work.

although I changed the sleep to 100.
and objIE.Navigate "about:blank" being left out wil make it fail. I guess you have to get IE to navigate somewhere successfully then wait for it to be ready, then send it to where you want.


Thanks
.

Thanks

John Fuhrman
Titan Global Services
 
:) awesome, glad it worked. [thumbsup2]

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top