Find IPv4, help me understand!?
Posted: 22 Aug 2012 12:08
Hi, i need help with this code/script. i havent done it, my self, i just want help to undesstand it a bit more
My code/Script:
@echo off
cls
title Internet Protocol (IP)
del IPv4.txt
echo.
for /F "TOKENS=2* DELIMS=:" %%a in ('IPCONFIG ^| find "IPv4"') do for %%b in (%%a) Do set MyIP=%%b
echo ============================= >> IPv4.txt
echo Your PC,s Internet Protocol,s >> IPv4.txt
echo ============================= >> IPv4.txt
echo Internet Protocol version 4: %MyIP% >> IPv4.txt
exit
Its this line i need help with: for /F "TOKENS=2* DELIMS=:" %%a in ('IPCONFIG ^| find "IPv4"') do for %%b in (%%a) Do set MyIP=%%b
The only thing i know is that its trying to find the word "IPv4", and i know that it creates an variable that saves in to an .txt file.
PLZ help me to understand the code =)
My code/Script:
@echo off
cls
title Internet Protocol (IP)
del IPv4.txt
echo.
for /F "TOKENS=2* DELIMS=:" %%a in ('IPCONFIG ^| find "IPv4"') do for %%b in (%%a) Do set MyIP=%%b
echo ============================= >> IPv4.txt
echo Your PC,s Internet Protocol,s >> IPv4.txt
echo ============================= >> IPv4.txt
echo Internet Protocol version 4: %MyIP% >> IPv4.txt
exit
Its this line i need help with: for /F "TOKENS=2* DELIMS=:" %%a in ('IPCONFIG ^| find "IPv4"') do for %%b in (%%a) Do set MyIP=%%b
The only thing i know is that its trying to find the word "IPv4", and i know that it creates an variable that saves in to an .txt file.
PLZ help me to understand the code =)