1.

Solve : Windows Batch file?

Answer»

Hi all,
I am very NEW to batch file programming.
i WANT to write a simple batch file which passes command like "snmpwalk "
on error it should be redirected to somefile , if successful it should'nt CONSIDER and it shud go to next IP.


So finally i need only error giving IP's

Pls help


Thanksheres a batch i wrote a lil while ago, will ping 10.1.1.1-254 and output the ip's that are successful, you should be able to modify this to what you want


@echo off
set a=1
:START
ping -n 1 -r 4 -a 10.1.1.%a%
echo %errorlevel%
if %errorlevel% ==0 (ping -n 1 -r 4 -a 10.1.1.%a% >> a.txt) else (echo error 10.1.1.%a%)
echo ------------ >> a.txt
set /a a+=1
if %a% == 255 goto end
goto start
:end
pause
exit



Discussion

No Comment Found