Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Name: klint
I tried using the ping command to provide a delay in a batch file (a similar function to the sleep.exe that comes with the Windows Resource Kit, except that ping is available on all Windows XP machines.)
PING 1.1.1.1 -n 1 -w 60000
This has been suggested in many places on the web as a way of waiting for 60 seconds. However, when I try it, it comes back immediately with the following error:
Reply from XXX: Destination host unreachable.(where XXX is my localhost IP address.)
Any idea why this is happening on my PC and obviously is not happening on other people's, otherwise they wouldn't have suggested this technique?
(I know I can use "ping -n 61 127.0.0.1 >nul" as a workaround, but was just wondering why the above didn't work.)

check your HOSTS file
=====================================
If at first you don't succeed, you're about average.M2

My hosts file just contains 127.0.0.1 localhost and a couple of other irrelevant mappings of hostnames on our Intranet. What exactly were you thinking of, that the problem could possibly be caused by my hosts file? It's just a mapping of hostnames to ip addresses isn't it? And when you supply an IP address to ping, it don't think it even looks at the hosts file at all. Have I overlooked something?

"And when you supply an IP address to ping, it don't think it even looks at the hosts file at all"
Actually, that's the first place it looks.
Are you using DHCP on your LAN? If you're not, I would suggest adding whatever static IP you have set to your HOSTS file, pointing it at localhost.

Tony,
Can you elaborate on "that's the first place it looks", as I must have misunderstood the role of the hosts file. I thought it was where it would look if you supplied a hostname, because it needs to convert it to an IP address. But if you supply a numeric IP address to begin with, what extra information does it need from the hosts file?
I don't use DHCP at work (where the ping returns immediately with the error message). I do use DHCP at home where the ping gives the required time delay. I don't have any mention of the IP address 1.1.1.1 in either hosts file. But then I don't understand how that would make any difference.

Sorry, ya you are correct. After re-reading your original post I see that. rDNS starts with your local DNS server, or ISP's DNS server, not the hosts file.
It sounds like a routing issue to me. The router could not find the network, 1.x.x.x.

klint: I thought it was where it would look if you supplied a hostname, because it needs to convert it to an IP address.
You are correct. Everyone else is crazy. CRAZY, I TELL YOU! But us? We're not crazy. No, not crazy at all... (You can verify this by either watching PING.EXE's stack, or by using PROCMON.EXE.)You'd probably gain more useful information by looking at the ROUTE PRINT command.
EDIT: VVV He admits! CRAZY! VVV

Thanks, I'm not a networking expert but the ROUTE command you suggest seems worth trying. I'll need to spend some time to understand it.

For reference, here's what a generic Windows route table looks like:
Sun 02/03/2008 13:20:32.26
E:\Documents and Settings>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 0c 41 64 70 96 ...... Wireless-G PCI Adapter - Packet Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.5 25
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.1.0 255.255.255.0 192.168.1.5 192.168.1.5 25
192.168.1.5 255.255.255.255 127.0.0.1 127.0.0.1 25
192.168.1.255 255.255.255.255 192.168.1.5 192.168.1.5 25
224.0.0.0 240.0.0.0 192.168.1.5 192.168.1.5 25
255.255.255.255 255.255.255.255 192.168.1.5 192.168.1.5 1
Default Gateway: 192.168.1.1
===========================================================================
Persistent Routes:
None

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |