Multi Ping batch file script
commandsIf you want ping for multi ip address and know the status in log file
This script will help you a lot
copy this all script in a notepad
save asping.bat file on desktop
And create a computers.txt text document in c:\ ( C drive)
Here give required IP address in computers.txt file
Like
Now You can ping and check the status N number of ip's at a time.
open ping.bat file which is saved on desktop
Its going to ping all ips and open a new log file with the status of all ip's
Its really helpful to system and network administrators.
@echo off (Set InputFile=c:\Computers.txt) title,Pinging list of computers &color 9e ::datestamp for /f "tokens=2-4 skip=1 delims=(-./)" %%i in ('echo.^|date') do ( for /f "tokens=1-4 delims=-./ " %%m in ('date /t') do ( (set dow=%%m)&(set %%i=%%n)&(set %%j=%%o)&(set yy=%%p) ) ) For /F "tokens=1,2 delims=:, " %%i in ('TIME /T') Do (Set HHMM=%%i%%j) (Set OutputFile=c:\Pinglog %yy%-%mm%-%dd% %HHMM%.txt) If Exist "%OutputFile%" Del "%OutputFile%" For /F "eol=;" %%* in ('type "%InputFile%"') do ( >>"%OutputFile%" (echo.&echo.---------------&( echo.%%*;&(ping -a -n 2 -w 750 %%* | Find ".")) )&echo.done %%*,) ::check start notepad.exe %OutputFile%
This script will help you a lot
copy this all script in a notepad
save as
And create a computers.txt text document in c:\ ( C drive)
Here give required IP address in computers.txt file
Like
Now You can ping and check the status N number of ip's at a time.
open ping.bat file which is saved on desktop
Its going to ping all ips and open a new log file with the status of all ip's
Its really helpful to system and network administrators.
@echo off (Set InputFile=c:\Computers.txt) title,Pinging list of computers &color 9e ::datestamp for /f "tokens=2-4 skip=1 delims=(-./)" %%i in ('echo.^|date') do ( for /f "tokens=1-4 delims=-./ " %%m in ('date /t') do ( (set dow=%%m)&(set %%i=%%n)&(set %%j=%%o)&(set yy=%%p) ) ) For /F "tokens=1,2 delims=:, " %%i in ('TIME /T') Do (Set HHMM=%%i%%j) (Set OutputFile=c:\Pinglog %yy%-%mm%-%dd% %HHMM%.txt) If Exist "%OutputFile%" Del "%OutputFile%" For /F "eol=;" %%* in ('type "%InputFile%"') do ( >>"%OutputFile%" (echo.&echo.---------------&( echo.%%*;&(ping -a -n 2 -w 750 %%* | Find ".")) )&echo.done %%*,) ::check start notepad.exe %OutputFile%
Subscribe to:
Posts (Atom)