Need help creating a .bat that performs the following function:
In the browser, Chrome opens the link www.123.ru , closes it in 5 seconds and opens it in www.456.ru , closes it in 5 seconds and opens the first link again, then the second again ... And so 77 times.

Tell me, please, how can this be fully implemented?

  • 2
    None? .. Close the tab in the browser is hard. But you can use curl for example. What is it for? - pavel
  • 3
    For this, it is better to use not a .bat file, but a macro on AutoIt. - Nofate
  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

Leaving aside the fact that “killing” processes is not good and Chrome will not like it, and also that all Chrome processes will be killed, even those that are not open by a batch file, the task is doable and the following [rednecks] code implements it:

 @echo off set CHROME_EXE=chrome.exe set CHROME="c:\Program Files (x86)\Google\Chrome\Application\%CHROME_EXE%" for /l %%i in (1,1,77) do ( call :five_sec "www.123.ru" call :five_sec "www.456.ru" ) goto :eof :five_sec start "" %CHROME% --incognito %1 timeout 5 taskkill /t /f /im %CHROME_EXE% > nul exit /b 

PS But keep in mind that for such an approach in a decent society they are beaten on the head with a candelabrum, and without asking questions many times.

  • And what did the antivirus say to this code?) - pavel
  • @pavel Avast Internet Security. Is silent. - user194374