批量打开和关闭网站 [英] Open and close websites in batch
问题描述
我正在尝试制作一个打开网站5秒钟的批处理文件,然后将其关闭然后关闭该批处理,我没有太多成功,现在有人在不让所有te cmd页面打开的情况下如何做到这一点屏幕(以便该批处理在运行后也可以关闭cmd)我希望有人可以帮助我.
I'm trying to make an batch file that opens a website for 5 seconds, then closes it an then loop the batch, I got not much Succes, does anyone now how to do this, without letting all te cmd pages on screen(so the batch also closes the cmd after running) I hope someone can help me.
这是我到目前为止获得的代码,它可以工作,但不会关闭cmd.exe(Web是.bat文件的名称)
this is the code i got so far, it works but it doesnt close the cmd.exe (Web is the name of the .bat file)
@echo off
start "chrome.exe" "http://www.websitehere. co"
timeout /t 3
taskkill /IM chrome.exe /F
:loop
start /wait Web
goto loop
Greetz Bas
Greetz Bas
推荐答案
我已经尝试过这段代码,希望对您有好处:
I've tried this code, hope it's good for you:
我做的是做一个while循环,让您选择循环运行多少次.
What i've done is do a while loop, for you to choose how many times will the loop run.
我将超时设置为10秒,但您可以将其更改为5秒.
I set the timeout as 10 seconds but you can change it for 5 seconds.
@echo off
set /A x=0
:while
if %x% LEQ 2 (
echo %x%
start /max chrome.exe https://www.google.es
timeout 10
taskkill /F /IM chrome.exe > null
set /A x=%x%+1
goto :while
)
这篇关于批量打开和关闭网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!