Question

Question about ping in command prompt

Hi,

How do I change the default ping address, for example, when i type

ping 4

in command prompt, it tries to ping 0.0.0.4, since my most common addresses are 192.168.0.* addresses, Id like to change it to 192.168.0.* from 0.0.0.*

Can someone tell me know to do this in windows 7?

Discussion is locked
Follow
Reply to: Question about ping in command prompt
PLEASE NOTE: Do not post advertisements, offensive materials, profanity, or personal attacks. Please remember to be considerate of other members. If you are new to the CNET Forums, please read our CNET Forums FAQ. All submitted content is subject to our Terms of Use.
Reporting: Question about ping in command prompt
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Comments
- Collapse -
Answer
Strange

When I open my Command Prompt, (Windows 7), and type in Ping, I see no default IP address.

Why not type in

ping {space} 192.168.0.4 ?

Mark

- Collapse -
AFAIK

AFAIK, that's the way it's been with ping since it's inception: ping <space> <IP Address to Ping>

There is nothing special about Windows 7's version of ping. It's basically the same as when Microsoft first created Winsock by porting FreeBSD's TCP/IP stack to Windows and renamed it Winsock. And FreeBSD's version of ping is effectively unchanged since the original ping was created back in like the 1960s.

This is where the HOSTS file can come in handy on a small network as a quick aside. You can use it to assign a hostname to a specific IP address. So I could name 192.168.0.4 as Number4 and then do: ping Number4

Obviously after 10-20 entries it starts to get a bit unwieldy which is why DNS was created.

- Collapse -
Answer
Very easy.

Write a batch file. Let's call it p.bat

Now p.bat could have one line in it such as

ping 192.168.0.%%1

Seems easy enough.
Bob

CNET Forums