First, determine the content of file 1.txt.
1. If there is Lost = 4, then add "Test failed" at the end of the file.
2. If there is "Reply from", then add "Test passed" at the end of the file.
3. If it is "Ping request could not find host www.*.com Please check the name and try again.", then add "Target host name cannot be resolved." at the end of the file.
4. If there is "TTL Expired in Transit", then add "The number of required hops exceeds the 'Time to Live' (TTL)." at the end of the file.
5. If it is "Destination Host Unreachable", then add "There is no local or remote route to the target host on the sending host or router." at the end of the file.
_______________________________________________
If there is the following information:
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=64
Request timed out.
Reply from 127.0.0.1: bytes=32 time<1ms TTL=64
Reply from 127.0.0.1: bytes=32 time<1ms TTL=64
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
______________________________________________________
Then replace it with the following.
______________________________________________________
Pinging 127.0.0.1 with 32 - byte data: (It is also acceptable to replace it with Pinging 127.0.0.1 is sending with 32 - byte data)
Reply from 127.0.0.1: bytes = 32 time < 1ms TTL = 64
Reply timed out.
Reply from 127.0.0.1: bytes = 32 time < 127.0.0.1's Ping statistics: (It is also acceptable to replace it with Ping statistics for 127.0.0.1:)
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)
Approximate round trip times in milliseconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
________________________________________________________
For NT systems such as 2000/XP, use the commands of the system to complete.
127.0.0.1 may be other IPs, that is, there are other files such as 2.txt, 3.txt, etc., and 127.0.0.1 may be 192.168.0.1 or www.21cn.com, etc.
It is just a part of the functions in batch processing. You can use all methods such as jumps, calls, generation, etc., but the commands must be built - in to the system.
If replacement is too troublesome, you can first make judgments. Ping seems to only return the above 5 kinds of results.
Say thank you first, and may check it on Monday.
[ Last edited by yangzhiyi on 2006 - 10 - 29 at 08:12 AM ]
1. If there is Lost = 4, then add "Test failed" at the end of the file.
2. If there is "Reply from", then add "Test passed" at the end of the file.
3. If it is "Ping request could not find host www.*.com Please check the name and try again.", then add "Target host name cannot be resolved." at the end of the file.
4. If there is "TTL Expired in Transit", then add "The number of required hops exceeds the 'Time to Live' (TTL)." at the end of the file.
5. If it is "Destination Host Unreachable", then add "There is no local or remote route to the target host on the sending host or router." at the end of the file.
_______________________________________________
If there is the following information:
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=64
Request timed out.
Reply from 127.0.0.1: bytes=32 time<1ms TTL=64
Reply from 127.0.0.1: bytes=32 time<1ms TTL=64
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
______________________________________________________
Then replace it with the following.
______________________________________________________
Pinging 127.0.0.1 with 32 - byte data: (It is also acceptable to replace it with Pinging 127.0.0.1 is sending with 32 - byte data)
Reply from 127.0.0.1: bytes = 32 time < 1ms TTL = 64
Reply timed out.
Reply from 127.0.0.1: bytes = 32 time < 127.0.0.1's Ping statistics: (It is also acceptable to replace it with Ping statistics for 127.0.0.1:)
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)
Approximate round trip times in milliseconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
________________________________________________________
For NT systems such as 2000/XP, use the commands of the system to complete.
127.0.0.1 may be other IPs, that is, there are other files such as 2.txt, 3.txt, etc., and 127.0.0.1 may be 192.168.0.1 or www.21cn.com, etc.
It is just a part of the functions in batch processing. You can use all methods such as jumps, calls, generation, etc., but the commands must be built - in to the system.
If replacement is too troublesome, you can first make judgments. Ping seems to only return the above 5 kinds of results.
Say thank you first, and may check it on Monday.
[ Last edited by yangzhiyi on 2006 - 10 - 29 at 08:12 AM ]
