ip=specific or write to .log

September 12, 2010 at 14:43:58
Specs: Windows XP
I need a batch file that saves my ip in a text file if it´s not a specific adress.
This is what i have tested right now and it dosent work for me, i can a bat file to find my curent ip and save it but only allways

@echo off
if not "IP-adress"==IP-adress . . . . . . . . . . . . :
Find "IP-adress" > ip.txt

I have tested to exclude the dots in the ip and theres no difrence for me, the reason i used the dots is that it includes them if i get a bat file to show my current ip in a .txt

See More: ip=specific or write to .log

Report •

September 12, 2010 at 14:53:20
ipconfig | find "IP Address" | find /v "" >> ip.txt

Report •

September 12, 2010 at 14:58:00
Try this:


FOR /f "tokens=14 delims= " %%a IN ('IPCONFIG ^| FINDSTR IPv4') DO (
	SET Var=%%a
	GOTO List


IF NOT "%Var%"=="" ECHO %Var% >> IP.log

EDIT: Razor beat me to the punch! Oh well. Whichever works best for you.

Can I put a question here?

Report •

September 17, 2010 at 07:26:43
Thanks for the fast help ppl :D
It worked like a charm

Report •

Related Solutions

Ask Question