Batch file to switch between browser tabs

旧街凉风 提交于 2020-01-03 04:44:27

问题


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


来源:https://stackoverflow.com/questions/20651893/batch-file-to-switch-between-browser-tabs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!