【DOS BAT】批量打开网页---通过脚本控制不同浏览器批量打开网页

在Windows下使用bat脚本批量打开网页,记录一下实现过程。

使用同一个浏览器有两种方式:
方式1是通过浏览器名直接打开该浏览器;
方式2是通过浏览器的绝对路径打开该浏览器。

当使用绝对路径时需要注意的问题:
1、如果该绝对路径中没有空格,没有中文字符,则可以直接使用该路径。例子:正文目录中的1.2.1和1.5.1。
2、如果包含中文字符,则需在bat第一行加入chcp 65001,才能成功打开该路径。例子:正文目录中的1.4.2。
3、如果包含空格,则需要加引号。例子:正文目录中的1.1.2和1.3.2。

一、使用不同浏览器批量打开网址

1.1 使用Edge批量打开网页

1.1.1 方式1:使用浏览器名字microsoftedge

首先新建一个txt文件,改名为open_edge.bat,右键 -> 编辑。
将以下命令复制进去:

@echo off
title open web 
timeout /nobreak /t 5
start microsoftedge "https://blog.csdn.net/AnChenliang_1002/article/details/109776186"
timeout /nobreak /t 5
start microsoftedge "https://blog.csdn.net/AnChenliang_1002/article/details/116646985"
timeout /nobreak /t 5
start microsoftedge "https://blog.csdn.net/AnChenliang_1002/article/details/115661773"
timeout /nobreak /t 5
start microsoftedge "https://blog.csdn.net/AnChenliang_1002/article/details/115675447"
timeout /nobreak /t 5
start microsoftedge "https://blog.csdn.net/AnChenliang_1002/article/details/115705732"

Echo.
Echo open web Number is 5
Echo.
timeout /nobreak /t 30

保存,退出,双击运行即可。
代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页。

1.1.2 方式2:使用Edge浏览器绝对路径(带空格)

@echo off
title open web 
timeout /nobreak /t 5
start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/109776186"
timeout /nobreak /t 5
start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/116646985"
timeout /nobreak /t 5
start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/115661773"
timeout /nobreak /t 5
start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/115675447"
timeout /nobreak /t 5
start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/115705732"

Echo.
Echo open web Number is 5
Echo.
timeout /nobreak /t 30

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"是我Edge浏览器的绝对路径,因为该浏览器默认装在C盘下,绝对路径(Program Files (x86))中带着空格,所以必须加双引号。

1.2 使用谷歌浏览器批量打开网址

1.2.1 使用谷歌浏览器绝对路径打开(不带中文、不带空格)

首先新建一个txt文件,改名为open_chrome.bat,右键 -> 编辑。
将以下命令复制进去:

@echo off
title 打开网页 
timeout /nobreak /t 10
start C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe "https://blog.csdn.net/AnChenliang_1002/article/details/123583335"
timeout /nobreak /t 10
start C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe "https://blog.csdn.net/AnChenliang_1002/article/details/109454465"
timeout /nobreak /t 10
start C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe "https://blog.csdn.net/AnChenliang_1002/article/details/123708355"
timeout /nobreak /t 10
start C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe "https://blog.csdn.net/AnChenliang_1002/article/details/110391085"
timeout /nobreak /t 10
start C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe "https://blog.csdn.net/AnChenliang_1002/article/details/109535355#comments_19244568"


Echo.
Echo ##5个页面,请确认数量##
Echo.
timeout /nobreak /t 10

保存,退出,双击运行即可。
代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页。

注意事项:
1、C:\Users\anchenliang\AppData\Local\Google\Chrome\Application\chrome.exe为我安装谷歌浏览器的绝对路径
2、该绝对路径中没有中文没有空格,所以可以直接使用该路径;否则的话,就得加引号了。

1.3 使用ie浏览器批量打开网址

1.3.1 方式1:直接使用浏览器名字iexplore

首先新建一个txt文件,改名为open_ie.bat,右键 -> 编辑。
将以下命令复制进去:

@echo off
title open web 
timeout /nobreak /t 5
start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/109776186"
timeout /nobreak /t 5
start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/116646985"
timeout /nobreak /t 5
start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/115661773"
timeout /nobreak /t 5
start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/115675447"
timeout /nobreak /t 5
start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/115705732"

Echo.
Echo ##5个页面,请确认数量##
Echo.
timeout /nobreak /t 30


保存,退出,双击运行即可。
代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页。

1.3.2 方式2:使用ie浏览器的绝对路径(带空格)

@echo off
title open web 
timeout /nobreak /t 5 

start "" "C:\Program Files\Internet Explorer\iexplore.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/109776186"
timeout /nobreak /t 5
start "" "C:\Program Files\Internet Explorer\iexplore.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/116646985"
timeout /nobreak /t 5
start "" "C:\Program Files\Internet Explorer\iexplore.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/115661773"
timeout /nobreak /t 5
start "" "C:\Program Files\Internet Explorer\iexplore.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/115675447"
timeout /nobreak /t 5
start "" "C:\Program Files\Internet Explorer\iexplore.exe" "https://blog.csdn.net/AnChenliang_1002/article/details/115705732"

Echo.
Echo open web Number is 5
Echo.
timeout /nobreak /t 30

"C:\Program Files\Internet Explorer\iexplore.exe"是我ie浏览器的绝对路径,因为该浏览器默认装在C盘下,绝对路径(Program Files (x86))中带着空格,所以必须加双引号。

1.4 使用火狐浏览器批量打开网址

1.4.1 方式1:直接使用浏览器名字firefox

首先新建一个txt文件,改名为open_fire.bat,右键 -> 编辑。
将以下命令复制进去:
方式1:直接使用firefox

@echo off
title open web 
timeout /nobreak /t 5
start firefox "https://blog.csdn.net/AnChenliang_1002/article/details/109776186"
timeout /nobreak /t 5
start firefox "https://blog.csdn.net/AnChenliang_1002/article/details/116646985"
timeout /nobreak /t 5
start firefox "https://blog.csdn.net/AnChenliang_1002/article/details/115661773"
timeout /nobreak /t 5
start firefox "https://blog.csdn.net/AnChenliang_1002/article/details/115675447"
timeout /nobreak /t 5
start firefox "https://blog.csdn.net/AnChenliang_1002/article/details/115705732"

Echo.
Echo ##5个页面,请确认数量##
Echo.
timeout /nobreak /t 30

保存,退出,双击运行即可。
代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页。

1.4.2 方式2:使用浏览器绝对路径(带中文字符)

chcp 65001
@echo off
title open web 
timeout /nobreak /t 5
start D:\安装的软件\firefox.exe "https://blog.csdn.net/AnChenliang_1002/article/details/109776186"
timeout /nobreak /t 5
start D:\安装的软件\firefox.exe "https://blog.csdn.net/AnChenliang_1002/article/details/116646985"
timeout /nobreak /t 5
start D:\安装的软件\firefox.exe "https://blog.csdn.net/AnChenliang_1002/article/details/115661773"
timeout /nobreak /t 5
start D:\安装的软件\firefox.exe "https://blog.csdn.net/AnChenliang_1002/article/details/115675447"
timeout /nobreak /t 5
start D:\安装的软件\firefox.exe "https://blog.csdn.net/AnChenliang_1002/article/details/115705732"

Echo.
Echo ##5个页面,请确认数量##
Echo.
timeout /nobreak /t 30

1.5 使用搜狗浏览器批量打开网页

1.5.1 使用搜狗浏览器的绝对路径(不带中文、不带空格)

首先新建一个txt文件,改名为open_sougou.bat,右键 -> 编辑。
将以下命令复制进去:

@echo off
title open web 
timeout /nobreak /t 5
start D:\sougou\SogouExplorer\SogouExplorer.exe "https://blog.csdn.net/AnChenliang_1002/article/details/109776186"
timeout /nobreak /t 5
start D:\sougou\SogouExplorer\SogouExplorer.exe "https://blog.csdn.net/AnChenliang_1002/article/details/116646985"
timeout /nobreak /t 5
start D:\sougou\SogouExplorer\SogouExplorer.exe "https://blog.csdn.net/AnChenliang_1002/article/details/115661773"
timeout /nobreak /t 5
start D:\sougou\SogouExplorer\SogouExplorer.exe "https://blog.csdn.net/AnChenliang_1002/article/details/115675447"
timeout /nobreak /t 5
start D:\sougou\SogouExplorer\SogouExplorer.exe "https://blog.csdn.net/AnChenliang_1002/article/details/115705732"

Echo.
Echo ##5个页面,请确认数量##
Echo.
timeout /nobreak /t 30

保存,退出,双击运行即可。
代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页。

注意事项:
1、D:\sougou\SogouExplorer\SogouExplorer.exe为我安装搜狗浏览器的绝对路径
2、该绝对路径中不能有中文,不能有空格,否则windows回找不到该exe文件。

二、循环批量打开网页、关闭网页

本文以IE浏览器为例,如果需要使用其他浏览器,参考上面的内容,把下面代码中的iexplore改为其他浏览器名字或绝对路径即可。

@echo off
title open web 

:acl
echo.
echo ## 即将批量打开的网页 ##
echo .
timeout /nobreak /t 5
start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/109776186"
timeout /nobreak /t 5
start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/116646985"
timeout /nobreak /t 5
start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/115661773"
timeout /nobreak /t 5
start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/115675447"
timeout /nobreak /t 5
start iexplore "https://blog.csdn.net/AnChenliang_1002/article/details/115705732"

echo ## 即将批量关闭已打开的网页,并再次循环打开 ##
timeout /nobreak /t 30
taskkill /f /im iexplore.exe
goto acl

::pause
exit

代码解释:
timeout /nobreak /t 5代表5秒后打开下一个,根据配置和网络延迟,自己修改。
注意,该值不要设置的太小,否则容易打开漏网页
taskkill /f /im iexplore.exe代表结束批量关闭ie浏览器,当然,ie中打开的网页也被批量关闭了。

  • 7
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

乘凉~

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值