Batch file to open multiple browsers


  1. Posts : 2
    W7RC
       #1

    Batch file to open multiple browsers


    Hello, I need 10 different browsers open and after some searching found a way to write a batch file which worked but with a couple of problems.

    The problem is it opens them all at once and several of the browsers crash. So I tried adding a ping after each one as follows:

    @echo off
    start /D "C:\Program Files (x86)\Google\Chrome\Application" chrome.exe
    PING 127.0.0.1 -n 1 -w 3500 >NUL
    start /D "D:\Program Files (x86)\SRWare Iron" iron.exe
    etc etc etc

    but they all still open at the same time, search gave other options like using "delay" but every other option I tried didn't work either.

    The other problem is that the browsers that don't crash are not responsive, they just sit there with a blank page until a "page unresponsive" kill window pops up.

    Even if I change the file so it is only a single line opening a single browser, it will open the browser and will say loading in the tab but nothing will happen. I have the windows loading circle cursor and i can still click on things but even if I say try to open the history, it will open a new tab for the history but it will just stay while until the unresponsive window pops up.

    So I am unable to get a batch file to open a browser and actually load the page and am also unable to get it to open multiple with a delay in between each. Any help would be appreciated.
      My Computer


  2. Posts : 53,364
    Windows 10 Home x64
       #2

    Welcome back newuser The way I usually see it written is

    ping -n 1 127.0.0.1

    Not sure if that makes a difference.

    Believe at least you want the ping time to be 11

    @echo off
    start /D "C:\Program Files (x86)\Google\Chrome\Application" chrome.exe
    PING 127.0.0.1 -n 11 -w 3500 >NUL

    When you use start like this ("title" can just be 2 quotes "" but cannot be left out) start "title" "program.exe" then the script starts program.exe and then returns at once, leaving program.exe running. So now you want to wait for a period of time before starting the next program. Ping can provide that delay and works with all versions of Windows. 127.0.0.1 is the IP address of the same computer that the script is running on. Its name is localhost. The ping command can take a parameter -n followed by a number which is the number of times to ping. The standard ping interval is 1 second. So ping -n 11 sends the first request and it gets a reply immediately, waits one second, sends the next request, gets an immediate reply, and so on – for the ten requests after the first. So to localhost those 11 times takes exactly 10 seconds. We redirect the output to nul so we don't see the ping command or its output on the screen.
    Source

    A Guy
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:33.
Find Us