Is it possible to use a batch file to ping multiple IP addresses, each in its own window?

60,792

Solution 1

It's pretty easy, save the following to a [.bat] file:

@echo off
rem start two new ping command windows from a batch file:
START cmd /k ping 8.8.8.8 /t
START cmd /k ping 127.0.0.1 /t

This will open two new command windows, each continuously pinging two different IP Addresses [8.8.8.8 && 127.0.0.1]

Solution 2

You can ping multiple IP addresses this way:

for /L %z in (1,1,254) do @ping 192.168.%z -w 10 -n 1 | find "Reply"

Change the IP address after the ping command to reflect your networks IP range. The above command will ping each address between 192.168.1.1 and 192.168.1.254 and return the IP address for reply to the ping.

The -w 10 makes it only wait 10 ms for a reply before moving on. If your network is slow you will have to up this value or take it out altogether.

Solution 3

Quickest way to ping multiple IP addresses Angry IP Scanner

This program will ping your specified IP addresses, domain in a window, also display hostname and ports open.

Quick and easy to use rather than separate cmd windows all over the place.

Solution 4

You can use the start command.

For example, to ping the 2 addresses you gave:

start ping 192.168.1.1 -t
start ping 192.168.2.1 -t
Share:
60,792

Related videos on Youtube

kabir
Author by

kabir

interested in learning computer networking.

Updated on September 18, 2022

Comments

  • kabir
    kabir over 1 year

    Can I create a batch file to ping multiple IP addresses, every IP address in new window. I don't want to open multiple windows and manually writing every single ping ping command.

    ex: ping 192.168.1.1 -t in one window and ping 192.168.2.1 -t to another window.

  • rockower
    rockower over 4 years
    your solution is for linux but they are asking about windows batch files
  • subtleseeker
    subtleseeker over 4 years
    fping is also available for windows.
  • rockower
    rockower over 4 years
    didn't realize that @subtleseeker I'm trying it out now.
  • Jonny Wright
    Jonny Wright almost 3 years
    This is a very cool command. Thank you