Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
326 views
in Technique[技术] by (71.8m points)

windows - Batch file to switch between browser tabs

I have two browser tabs running monitoring applications on a screen. I want to automate switching between tabs after lets say every 2 mins. I think this can be achieved by creating a scheduled task in windows which execute a batch file every 2 mins. Batch file will switch the tab. I need help creating such batch file. Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use VBScript to do that,

Example for IE :

Create a file Switch.vbs with this :

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.AppActivate "Internet Explorer"
Wscript.Sleep 1500
WshShell.SendKeys "^{TAB}"
Wscript.Sleep 1500

After opening your 2 tabs in IE run the command every 2 minutes :

wscript.exe switch.vbs

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...