Introduction to Pinging Multiple Hosts from the Command Prompt
Network administrators and IT professionals frequently need to check the connectivity of multiple hosts at once. The standard ping command is a simple tool that sends ICMP echo requests to a single destination, but when you need to verify dozens or even hundreds of IP addresses, running one ping at a time becomes impractical. Fortunately, the Windows Command Prompt and PowerShell offer several built-in methods to ping many hosts simultaneously or sequentially without opening separate windows for each target. This article explores these techniques, from basic batch loops to parallel execution using PowerShell jobs, and also mentions a third-party GUI tool for those who prefer a visual interface.
Using a Batch For Loop to Ping a Range of IP Addresses
The most common approach for pinging a contiguous range of IPs in Command Prompt is to use a for loop. This method works perfectly when you need to scan an entire subnet, such as 192.168.0.1 through 192.168.0.254. The command iterates through numbers from 1 to 254, pinging each address and filtering the results to show only replies. The syntax is as follows:
for /L %i in (1,1,254) do ping -n 1 -w 20 192.168.0.%i | find "Reply"

In this command, /L indicates a loop that increments a variable; %i is the loop variable starting at 1, incrementing by 1, and stopping at 254. The ping command sends a single echo request (-n 1) with a timeout of 20 milliseconds (-w 20). The pipe to find "Reply" filters out all lines except those containing the word "Reply", which indicates a successful ping. This results in a clean output of only the responding IPs. You can adjust the timeout or the IP range as needed. Note that this runs the pings sequentially, one after another, so it can take a bit of time depending on the timeout and number of addresses.
Pinging Multiple Specific IPs in One Command
If you need to ping a handful of specific IP addresses rather than a full range, you can pass multiple addresses to the ping command separated by spaces. For example:
ping 8.8.8.8 1.1.1.1 8.8.4.4

This command will ping the first address (8.8.8.8) and then automatically proceed to ping the next, and so on. The results are displayed in order, and each ping uses the default settings (four echo requests by default). This is a quick way to test a small list of hosts, but note that the pings are still sequential – the command does not launch them simultaneously. It is simple and requires no scripting, making it useful for ad‑hoc checks.
PowerShell Test-Connection Cmdlet for Parallel Probing
Windows PowerShell provides a modern alternative to the legacy ping.exe: the Test-Connection cmdlet. One of its advantages is the ability to ping multiple computers in parallel. The basic syntax is:
Test-Connection -ComputerName 8.8.8.8, 1.1.1.1, 8.8.4.4 -Count 1

Here, the -ComputerName parameter accepts a comma‑separated list of IP addresses or hostnames. The -Count 1 parameter limits each host to a single echo request. By default, Test-Connection pings the targets asynchronously (in parallel), which greatly reduces the total time compared to sequential approaches. The output shows the results for each host, including whether the ping succeeded (Reply) or timed out. You can also use -Quiet to return a simple Boolean value, or -Detailed for more information. This cmdlet is the recommended method within PowerShell for ICMP testing of multiple hosts.
Parallel Execution with PowerShell Background Jobs
For scenarios where you need to continuously ping multiple hosts in the background (for example, monitoring connectivity over time), you can use PowerShell Start-Job to run each ping command as a separate background job. Each job runs independently and concurrently. A script block can be created that loops indefinitely while pinging a specific IP. An example approach:
Start-Job -ScriptBlock { while($true) { ping -n 1 $args[0] | Out-Null; Start-Sleep -Seconds 5 } } -ArgumentList "192.168.1.1"

Launching multiple such jobs – one for each target IP – allows you to monitor many hosts at once. The advantage is that each job runs in its own thread, so the pings are truly simultaneous. The disadvantage is that managing and cleaning up many jobs can become complex if you have dozens of targets. You can use Get-Job to list jobs and Receive-Job to retrieve their output. For a simpler parallel monitoring, consider using the -Continuous switch of Test-Connection in newer PowerShell versions, but note that continuous ping is not natively parallel for multiple hosts without jobs or runspaces.
Third-Party Tool: PingInfoView
If you prefer a graphical interface without writing scripts, a third‑party utility like PingInfoView by NirSoft provides an intuitive solution. This free tool allows you to enter a list of IP addresses or hostnames and ping them all simultaneously. The results are displayed in a table with columns for host name, IP address, reply time, TTL, and status. You can export the list to HTML, CSV, or text, and it supports continuous pinging. Many network administrators find this tool invaluable for quick visual checks of multiple endpoints. You can download PingInfoView from the NirSoft website. While not part of the operating system, it is lightweight, portable, and widely used in professional environments.
Comparison of Methods for Pinging Multiple Hosts
To help you choose the best method for your situation, the following table summarises the key differences between the approaches discussed.

| Method | Parallel or Sequential | Best Use Case | Complexity |
|---|---|---|---|
| Batch For Loop | Sequential | Scanning an IP range in classic CMD | Low |
| Single Command (space‑separated) | Sequential | Quick test of a few specific IPs | Very low |
| PowerShell Test-Connection | Parallel (asynchronous) | Fast simultaneous check of a list | Low |
| PowerShell Background Jobs | Parallel (true concurrency) | Continuous monitoring of many hosts | Medium |
| PingInfoView (NirSoft) | Parallel | GUI‑based monitoring, non‑scripters | Very low (tool) |
List of Common Options and Parameters
Below is a list of useful parameters that can be combined with the methods above to refine your ping operations.
- -n count – Sets the number of echo requests to send (default is 4).
- -w timeout – Specifies the timeout in milliseconds to wait for each reply.
- -t – Pings the specified host continuously until interrupted (Ctrl+C).
- -l size – Sets the buffer size of the ping packet.
- -4 / -6 – Forces the use of IPv4 or IPv6.
- -a – Resolves IP addresses to hostnames (if available).
- -Quiet (PowerShell Test-Connection) – Returns Boolean values instead of detailed objects.
- -Count (PowerShell Test-Connection) – Equivalent to -n in classic ping.
When using the batch for loop, you can incorporate any of these parameters inside the ping command. For example, using -t in the loop would cause each ping to run endlessly, which is not recommended unless you intend to manually stop the command. For continuous monitoring of a set of hosts, use PowerShell background jobs with a sleep interval.
Practical Example: Monitoring a Small Office Network
Suppose you manage a network with ten servers (IP addresses 192.168.10.1 to 192.168.10.10). You want to quickly verify which are online. In Command Prompt, you could use the batch loop limited to that range: for /L %i in (1,1,10) do ping -n 1 -w 100 192.168.10.%i | find "Reply". This will take about 10×100 ms = 1 second for timeouts plus replies, so about two seconds total. Alternatively, in PowerShell: Test-Connection -ComputerName (1..10 | ForEach-Object {"192.168.10.$_"}) -Count 1. This will run in parallel and finish in under a second. For continuous monitoring, you could start ten background jobs each pinging one server every five seconds.
If you need to keep an eye on those servers all day, consider using PingInfoView. Simply add the ten IPs to the list, click Start, and the tool will show live ping results. You can then minimize it and glance at the status whenever you need.
Important Considerations and Limitations
When pinging multiple hosts, be aware of potential firewall blocks. Many networks and hosts have ICMP filtered for security reasons, which can cause false timeouts. Additionally, sending many pings in a short time might be considered network noise; be mindful of your network’s policies. In PowerShell, running many background jobs can consume memory and CPU if the count exceeds a few dozen. For large‑scale scans, dedicated tools like Nmap are more appropriate. The methods described here are intended for quick administrative checks, not for network discovery or vulnerability scanning.
Conclusion
Pinging multiple hosts from the command prompt is a common task that can be accomplished without third‑party software using built‑in tools. The batch for loop is ideal for sequential scanning of IP ranges in classic CMD. For a list of specific addresses, simply listing them after ping works. PowerShell’s Test-Connection provides fast parallel probing, and background jobs enable continuous parallel monitoring. For users who prefer a graphical interface, PingInfoView offers a simple solution. Each method has its trade‑offs, and the best choice depends on your environment and needs. Mastering these techniques will save you time and improve your network troubleshooting efficiency.
References
The factual content in this article is based on documentation and community resources. For further details, consult the following sources:
- Microsoft Learn documentation on the ping command.
- SuperUser discussion about pinging a range of addresses using a batch loop: CMD.exe command to ping a range of addresses.
- Microsoft Docs for the Test-Connection cmdlet.
- NirSoft’s PingInfoView utility: PingInfoView.





