1.

Solve : Help with getting batch to a txt file?

Answer»

Hi I want to use a batch script to copy my IP address and SAVE it in a txt file. Is there anyway I could do that through dos? It would really help if somebody could help me. Thank you.Easy here ya go !

Code: [Select]ipconfig>> ipaddress.txtOh my gosh thank you so much you are a life saver! Your welcome, ALWAYS happy to help. But may I ask why you needed that, just asking?

8-)fffreakjust GET IP addresses
Code: [Select]@echo off
::
:: get all IP addresses and assign to IPaddr1, IPaddr2, etc.
::
SET CTR=0
for /f "tokens=2 delims=:" %%a in (
'ipconfig ^|find "IP Address"'
) do call :saveIP %%a
for /l %%a in (1,1,%ctr%) do call :showIP %%a
goto :EOF

:showIP
call :exec echo IP Address %1 is %%IPaddr%1%%%
goto :EOF

:saveIP
set /a ctr+=1
set IPaddr%ctr%=%1
goto :EOF
:exec
%*
goto :EOF
EOF



Discussion

No Comment Found