批处理文件,在打开的浏览器URL变化 [英] Batch file that changes URL in open browser
问题描述
我见过这样的事情:
start /d "C:\Program Files\Internet Explorer (x86)\IEXPLORE.EXE" www.google.com
但是,这只是打开一个新的标签。我想它改变什么网站是开放的列出的。
But this just opens a new tab. I would like it to change the whatever website is open to the one listed.
的最终目标是创建一个与它们之间的给定延迟的两个网页之间切换的批处理文件。
The end goal is to create a batch file that switches between two webpages with a given delay between them.
推荐答案
您可以直接在批处理文件中使用的SendKeys,如图<一个href=\"http://stackoverflow.com/questions/22866137/automatically-respond-to-runas-from-batch-file/22870934#22870934\">this或<一个href=\"http://stackoverflow.com/questions/22836457/how-to-make-a-batch-file-to-run-a-hotkey/22843382#22843382\">this或<一个href=\"http://stackoverflow.com/questions/17038282/$p$pss-keyboard-keys-using-a-batch-file/17050135#17050135\">this回答;例如:
You may use SendKeys directly in your Batch file, as shown in this or this or this answer; for example:
@if (@CodeSection == @Batch) @then
@echo off
rem Start default IE
start /d "C:\Program Files\Internet Explorer (x86)\IEXPLORE.EXE" www.google.com
:changeLoop
CScript //nologo //E:JScript "%~F0" "keys to change to first webpage"
timeout /T 10
CScript //nologo //E:JScript "%~F0" "keys to change to second webpage"
timeout /T 10
goto changeLoop
@end
WScript.CreateObject("WScript.Shell").SendKeys(WScript.Arguments(0));
这篇关于批处理文件,在打开的浏览器URL变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!