|
|
|
Mechanix2 - Need batch help
|
Original Message
|
Name: vortech
Date: March 21, 2007 at 13:54:31 Pacific
Subject: Mechanix2 - Need batch helpOS: Windows 2000CPU/Ram: 2 GHZModel/Manufacturer: Home Built |
Comment: Mechanix2, I found this batch file that you created for someone here, and would like to expand on it. :: multiIP.bat @echo off > pingLOG for /f "tokens=*" %%I in (IPlist) do call :pinger %%I goto :eof :pinger echo %TIME% >> ping ping -a %1 >> pingLOG :: DONE Only change I have made is to add the -a in ping to have it also resolve the IP to a PC name. Is there any way "via batch" to take the output of this and filter it so I only see the IP address of the PC and it's workstation name? Thanks for any help you can provide!
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: Mechanix2Go
Date: March 21, 2007 at 14:22:39 Pacific
Subject: Mechanix2 - Need batch help |
Reply: (edit)Try this: ::== mip2.bat @echo off setLocal EnableDelayedExpansion for /f "tokens=* delims= " %%a in (IPlist) do ( call :pinger %%a ) goto :eof :pinger ping -a %1 > pingLOG find "Pinging" < pingLOG > pinging find "Reply" < pingLOG > reply for /f "tokens=2 delims= " %%a in (pinging) do ( echo %%a ) for /f "tokens=3 delims= " %%a in (reply) do ( set IP=%%a ) echo !IP:~0,-1! goto :eof ::==
===================================== If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: vortech
Date: March 21, 2007 at 15:28:11 Pacific
Subject: Mechanix2 - Need batch help |
Reply: (edit)Mechanix2, Thanks for the quick response! I'm having a few problems with the file above. My IPlist file looks like this 192.168.10.165 192.168.10.175 When I run the batch file, it only displays the output of the the first machine in the dos window like this. (for a few seconds then it disappears) JIM 192.168.10.165 I don't see anything for the second. Stranger still, when I then open up pingLOG, pinging, and the reply files, I only see the entries referencing the 2nd host (192.168.10.175) My goal would be to output everything to a single text file, in the following format: JIM 192.168.10.165 JOE 192.168.10.175 etc Hope that makes sense, Thanks again!
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: Mechanix2Go
Date: March 21, 2007 at 16:12:38 Pacific
Subject: Mechanix2 - Need batch help |
Reply: (edit)[1] The quick closing of the window would indicate you're not running it from a prompt. I've got this in IPlist: 127.0.0.1 192.168.10.165 192.168.10.175 and I get: BIG933 127.0.0.1 192.168.10.165 58.147.0.50 192.168.10.175 58.147.0.50 Unsirprisingly, my doesn't resolve to JIM & JOE. The reason that the logs show only the last IP is that a fresh one is created with each CALL. The fact that they contain 192.168.10.175 means they are doing both. Try it at the prompt.
===================================== If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: vortech
Date: March 21, 2007 at 16:35:53 Pacific
Subject: Mechanix2 - Need batch help |
Reply: (edit)Yep that was it, I see both IPs and their corresponding hostnames now. Any way to output this info to a file, instead of on screen, and make it so the IP and hostname are on the same line? Thank you very much!
Report Offensive Follow Up For Removal
|
|
Response Number 5
|
Name: Mechanix2Go
Date: March 21, 2007 at 16:48:06 Pacific
Subject: Mechanix2 - Need batch help |
Reply: (edit)::== mip3.bat @echo off setLocal EnableDelayedExpansion for /f "tokens=* delims= " %%a in (IPlist) do ( call :pinger %%a ) goto :eof :pinger ping -a %1 > pingLOG find "Pinging" < pingLOG > pinging find "Reply" < pingLOG > reply for /f "tokens=2 delims= " %%a in (pinging) do ( set name=%%a ) for /f "tokens=3 delims= " %%a in (reply) do ( set IP=%%a ) echo !name! !IP:~0,-1! >> name2IP.txt goto :eof ::==
===================================== If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 7
|
Name: Mechanix2Go
Date: March 21, 2007 at 21:56:33 Pacific
Subject: Mechanix2 - Need batch help |
Reply: (edit)You owe me two beers. ===================================== If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 8
|
Name: alpabarot
Date: March 21, 2007 at 22:30:27 Pacific
Subject: Mechanix2 - Need batch help |
Reply: (edit)Hi, You have a very cool Forum here…loved the content. U know there is an awesome opportunity for people like you who have ur own Forums n sites…I came across this site called Myndnet.com…it’s a platform for people for buy and sell Technology related information. and everytime you sell some information you get paid for it…Good money for people like us in the IT domain. Here the link http://www.myndnet.com/login.jsp?re... Sign up is free…check it out… You can contact me at my id here for more questions : barot.alpa@gmail.com Cheers Alpa
Report Offensive Follow Up For Removal
|
|
Response Number 9
|
Name: vortech
Date: March 22, 2007 at 15:02:24 Pacific
Subject: Mechanix2 - Need batch help |
Reply: (edit)You know I actually went to your site and saw the paypal , but I can't read any of the text, it's all just small squares??
Report Offensive Follow Up For Removal
|
|
Response Number 10
|
Name: Mechanix2Go
Date: March 23, 2007 at 00:03:44 Pacific
Subject: Mechanix2 - Need batch help |
Reply: (edit)Hi vortech, I I'm glad you told me. I checked it out and I see the characters where you see squares. It's Japanese. The last time I yesyed it, it was in English so I guess Paypal must have 'regionalized' it. SHEESH I wonder how many others have had the prob. My user on Paypal is: Advertise [AT] ThaiGuides.com Thanks
===================================== If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
|
Response Number 11
|
Name: Mechanix2Go
Date: March 24, 2007 at 04:07:20 Pacific
Subject: Mechanix2 - Need batch help |
Reply: (edit)vortech, I fixed the paypal button. Thanks for letting me know. ===================================== If at first you don't succeed, you're about average.M2
Report Offensive Follow Up For Removal
|
Use following form to reply to current message:
|
|

|