ping command (Windows / CMD)
What it does
Test reachability and measure response time with ICMP echo requests. Searches for the ping command cmd windows usually need CMD syntax, practical switches, and notes on how it compares with PowerShell or Linux alternatives. This page covers syntax, common options, and copyable examples for Command Prompt.
Test reachability and measure response time with ICMP echo requests.
Syntax
ping [/t] [/a] [/n count] [/w timeout] target_name
Common options
| Flag / option | Meaning |
|---|---|
| /n count | Send a fixed number of requests. |
| /t | Continue until interrupted. |
| /w timeout | Set timeout in milliseconds. |
| /4 | Force IPv4. |
| /a | Resolve addresses to host names. |
Practical examples
Default test
ping example.com
Sends four echo requests on Windows.
Ten probes
ping /n 10 8.8.8.8
Sends exactly ten requests.
Short timeout
ping /n 2 /w 1000 192.0.2.1
Waits at most one second per reply.
Linux ↔ Windows equivalent
Closest match: ping (Linux / bash / sh / zsh). Test IP reachability and measure round-trip response time.
Common mistakes
- Treating ICMP filtering as proof that the target application is unavailable.
- Using `/t` in automation without a termination plan.
Related commands
- tracertTrace routers traversed on the way to an IP destination.
- ipconfigDisplay and manage Windows IP configuration and DNS client state.
- pingTest IP reachability and measure round-trip response time.
- curlTransfer data to or from URLs using many network protocols.
- sshOpen a secure remote shell or run a command over SSH.
- Invoke-WebRequestSend HTTP and HTTPS requests and return response metadata and content.
- netstatDisplay active connections, listening ports, routing data, and protocol statistics.
- scpCopy files securely between local and SSH-accessible hosts.
FAQ
What does ping do in Command Prompt?
Test reachability and measure response time with ICMP echo requests.
How do I run ping in CMD?
Open Command Prompt and follow `ping [/t] [/a] [/n count] [/w timeout] target_name`; quote paths containing spaces.
What is a practical ping example in CMD?
Try `ping example.com` — Sends four echo requests on Windows.
Can ping be used in a batch file?
Yes. Check its exit code and escape CMD metacharacters when input is variable.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.