Example batch job:  Check an IP adres


echo off

cd\

 

title=find IP adres & Check references

:nogus

cls

 

:nogus2

echo.

echo.

SET /P testwww=Type www.****.** then press ENTER:

 

ping -n 1 -w 1 %testwww%>%temp%\test.txt

 

echo.

findstr "[" %temp%\test.txt>%temp%\ipconfigout.txt

if %errorlevel%==0 (findstr %testwww% %temp%\test.txt>%temp%\ipconfigout.txt) else (echo not found&goto nogus2)

 

echo ***********************************************************

type %temp%\ipconfigout.txt

echo ***********************************************************

echo.

echo please wait

echo.

set  zoekstring=Pingen naar %testwww% [

 

:start

set result=

set outstring=

:next

cls

echo.

echo ** %zoekstring%

set htel=0

:teller

set input=%zoekstring%%htel%

findstr /I /C:"%input%" "%temp%\ipconfigout.txt"> nul

if %errorlevel%==0 goto ready

if %htel%==9 set htel=.&goto teller

if %htel%==. goto klaar

set/a htel=%htel%+1

goto teller

 

:ready

set outstring=%zoekstring%%htel%

set zoekstring=%outstring%

set result=%result%%htel%

goto next

 

 

:klaar

::echo %outstring%

echo.

echo IPadres isolated: ***%result%***

 

start iexplore.exe http://whatismyipaddress.com/ip/%result%

 

:haha

set again=n

SET /P again=again (y/n)?

if %again%==y goto nogus

 

 

 

exit