Batch file to switch between browser tabs

2019-06-11 07:10发布

问题:

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.

回答1:

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