Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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
)

@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

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

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