Quote:
Originally Posted by computerman29642 I have the following code... Code: ping 127.0.0.1 -n 1 -w 120000
start outlook.exe /m
I thought that Outlook would wait 2 minutes before opening, but it opens right away. What am I doing wrong? |
Quote:
Originally Posted by TheOutcaste The address you ping must be one that does not exist |
the -w (wait) switch tells ping how long to wait for a reply. If the address responds, the wait parameter has no affect. with th -n 1 parameter it only sends one ping, so the wait tiime will be only 1 second. If you want to use an address that responds then use -n (number of packets to send) as devil_himself has indicated. Each ping takes approximately 1 second.
Either method will work. Just a matter of preference.
Pinging the localhost address doesn't send any packets over the network, but the network card is sending and receiving the packets internally (60 bytes each, 120 bytes per ping) so it could possibly have a slight effect on sending/receiving other data, but it's not too likely.
Pinging a non-existent address sends one 60 byte packet, then waits for a timer to timeout, so the network card isn't actually processing any data. Timing with this method also
seems to be less affected by other processes hogging processor time, but I have no real data to prove that one way or the other.
Jerry