Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all!
In this batch file:
:: multiIP.bat
@echo onfor /f "tokens=*" %%I in (c:\tmp\IPlist) do call :pinger %%I
goto :eof:pinger
ping -a %1 >> pingLOG
:: DONEI would like to extract the result of the line containing the hostname and the IP in IPlist.
These two results would be inserted in a new log file.I managed with:
:: getinfo.bat
@ECHO ONfor /f "skip=1 tokens=2,3" %%i in (pingLOG) do @echo %%i %%j >> result.txt
start notepad.exe result.txt
:: Pause for 5 sec
ping -n 5 localhost > NULdel result.txt
:: DONEto "extract" the two actual tokens but I do not need the lines after those in result.txt
Could anyone give me some idea, help?
Thanks!
ErikWhat?

for /f " tokens=2,3" %%i in ('find "Pinging" ^< pingLOG') do (
echo %%i %%j >> result.txt
)
=====================================
If at first you don't succeed, you're about average.M2

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

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