Computing.Net > Forums > Programming > .bat ping txt file list of pcs

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

.bat ping txt file list of pcs

Reply to Message Icon

Name: kinetic
Date: October 5, 2006 at 09:04:58 Pacific
OS: winxp
CPU/Ram: intel 2gb ram
Product: ibm
Comment:

Hi there. i have this script but its outputting erroneous results.. some of the machines are not pingable but its not reporting them... can anyone help? thank you in advance!

@echo off

echo The following machines are not pingable:>>3167_PingCheck.txt
echo.>>3167_PingCheck.txt
for /f "tokens=1 delims=" %%a, in (3167_Assets.txt) do (
ping -n 1 %%a
IF %ERRORLEVEL% == 1 echo %%a >>3167_PingCheck.txt
)

echo The following machines are not pingable:>>3256_PingCheck.txt
echo.>>3256_PingCheck.txt
for /f "tokens=1 delims=" %%b, in (3256_Assets.txt) do (
ping -n 1 %%b
IF %ERRORLEVEL% == 1 echo %%b >>3256_PingCheck.txt
)

echo The following machines are not pingable:>>4661_PingCheck.txt
echo.>>4661_PingCheck.txt
for /f "tokens=1 delims=" %%c, in (4661_Assets.txt) do (
ping -n 1 %%c
IF %ERRORLEVEL% == 1 echo %%c >>4661_PingCheck.txt
)

echo The following machines are not pingable:>>5510_PingCheck.txt
echo.>>5510_PingCheck.txt
for /f "tokens=1 delims=" %%d, in (5510_Assets.txt) do (
ping -n 1 %%d
IF %ERRORLEVEL% == 1 echo %%d >>5510_PingCheck.txt
)



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: October 5, 2006 at 10:09:52 Pacific
Reply:

@echo off > log
for /f %%I in (IPlist.txt) do (
ping %%I | find "Reply" > nul
if errorlevel 1 echo %%I did not reply >> log )


=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 2
Name: kinetic
Date: October 5, 2006 at 11:02:55 Pacific
Reply:

that worked perfectly!!

thanks a million!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: .bat ping txt file list of pcs

Ping list of computers from a txt file www.computing.net/answers/programming/ping-list-of-computers-from-a-txt-file/19843.html

%var% from a txt file vbs www.computing.net/answers/programming/var-from-a-txt-file-vbs-/14365.html

.bat wildcards in .txt files www.computing.net/answers/programming/bat-wildcards-in-txt-files/11236.html