| 1. |
Solve : [Batch] Ping Script?? |
|
Answer» It is possible to make something LIKE this ... not working ( Fine here... Code: [Select]C:\Batch\Test>aveping.bat Your connection to Yahoo.com is 188ms C:\Batch\Test> Windows 7 Professional Quote from: CaTaLinU on May 09, 2012, 10:11:55 AM not working (Don't know what to tell you. Works just fine for me. Code: [Select]C:\batch files>ping_avg.bat Your connection to Yahoo.com is 49ms( F**king windows ......... Someoen knows from what is this "error" For Salmon Trout worked this script but for me the console remain blank...Maybe he doesn't want to do batch arithmetic; perhaps he just wants to isolate the average part of the ping output summary line... C:\Batch\Test>ping www.yahoo.com Pinging eu-fp3.wa1.b.yahoo.com [87.248.122.122] with 32 bytes of data: Reply from 87.248.122.122: bytes=32 TIME=52ms TTL=52 Reply from 87.248.122.122: bytes=32 time=51ms TTL=52 Reply from 87.248.122.122: bytes=32 time=75ms TTL=52 Reply from 87.248.122.122: bytes=32 time=50ms TTL=52 Ping statistics for 87.248.122.122: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round TRIP times in milli-seconds: Minimum = 50ms, MAXIMUM = 75ms, Average = 57ms easy enough... for /f "tokens=1-9" %%A in ('ping www.yahoo.com ^| find "Average ="') do echo Average=%%I Quote from: CaTaLinU on May 09, 2012, 10:52:39 AM For Salmon Trout worked this script but for me the console remain blank... It worked for Squashman too. 1. Please don't use bad language, even censored. 2. How are you running this code? Bat File Name - ping.bat code given by Squashman is not changed, i run it how he give it to me the Double-Click on ping.bat if i wait more than 30 sec my pc it will work very slowly ..Quote from: Salmon Trout on May 09, 2012, 10:53:43 AM Maybe he doesn't want to do batch arithmetic; perhaps he just wants to isolate the average part of the ping output summary line...That makes the code a lot easier. Not sure why I didn't do that in the first place.Quote from: CaTaLinU on May 09, 2012, 11:01:27 AM Bat File Name - ping.bat Sounds about right, mine took nearly 23 seconds. Maybe you have a slow connection? C:\Batch\Test>( More? echo %time% More? aveping.bat More? echo %time% More? ) 18:18:24.61 Your connection to Yahoo.com is 158ms 18:18:47.23 Quote from: CaTaLinU on May 09, 2012, 11:01:27 AM Bat File Name - ping.batWell there is your mistake. You can't name your batch file the same as a command in your batch file!!!!!!!Quote from: Squashman on May 09, 2012, 11:21:17 AM Well there is your mistake. You can't name your batch file the same as a command in your batch file!!!!!!! I missed that... I just assumed nobody would ever call a batch script ping.bat... Quote from: Salmon Trout on May 09, 2012, 11:24:40 AM I missed that... I just assumed nobody would ever call a batch script ping.bat... Now works fine Thx a lot Quote from: CaTaLinU on May 09, 2012, 11:29:27 AM Now works fineWould probably run a tad faster if you used Salmon Trout's code. |
|