Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

[vbscript] switching browser windows

$
0
0

I got a VB script which is created to open a browser with predefined url and pass the user credentials. Everything is working fine for one window.

Now I want to enhance this script to switch through other browser windows (like browser window1 and browser window 2........) in the taskbar over a specified interval of time (like 5 to 10 min). I don't mind to minimize one window and maximize the other one.

Could you guys, please help me.

Here is the sample code

 

Const strURL = "<URL>"
Const strID = "<UserName>"
Const strPswd = "<Password>"

Set objIE = CreateObject( "InternetExplorer.Application" )
objIE.Visible = True
objIE.Navigate2 strURL
 
Do While objIE.Busy
    WScript.Sleep 100
Loop
 
Set objShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 1000
'objShell.SendKeys "{TAB 2}"
'WScript.Sleep 100
'objShell.SendKeys "~"
objShell.SendKeys strID
WScript.Sleep 100
objShell.SendKeys "{TAB}"
WScript.Sleep 100
objShell.SendKeys strPswd
WScript.Sleep 100
objShell.SendKeys "{ENTER}"

Please let me know incase you guys need any more information in this regard.

 


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>