Page 1 of 1
get ip for batch commands
Posted: 15 Oct 2009 14:05
by vandel212
I was wondering if it were possible to ping the current ip address of the computer. The reason I would like to do this is because it is constantly changing on my network and I would just like to ping the current address instead of changing it every time.
Thanks in advance.
Posted: 15 Oct 2009 15:56
by avery_larry
You can use the ip 127.0.0.1
Otherwise you can use some manipulations with for to get the IP address from ipconfig.
Posted: 16 Oct 2009 03:57
by gianniiiii
avery_larry wrote:You can use the ip 127.0.0.1
Otherwise you can use some manipulations with for to get the IP address from ipconfig.
i use this,
IPCONFIG |FIND "IP" > %temp%\TEMPIP.txt
FOR /F "tokens=2 delims=:" %%a in (%temp%\TEMPIP.txt) do set IP=%%a
del %temp%\TEMPIP.txt
Posted: 16 Oct 2009 12:35
by jaffamuffin
FOR /F "tokens=2 delims=:" %%a in ('IPCONFIG ^|FIND "IP"') DO ECHO %%a
Posted: 16 Oct 2009 18:44
by avery_larry
Great until you have multiple adapters.
Posted: 19 Oct 2009 02:57
by gianniiiii
@Jaffamuffin
also ifmaybe it's better to open a new Topic, i can't found resource about the character "^"
is there a topic here?
Posted: 19 Oct 2009 03:21
by gianniiiii