I have a problem with my Batch file. In my file, i want to get the IP address of my machine as a variable.
Im running Windows Server 2003 R2
So, this is what i tried :
for /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "IP"') do set ip==%%b
set ipAddress=%ip:~1%
echo IP Address : %ipAddress%
This work well on my others machines but not on this one because i have multiple ip address in ipconfig.
When i write "ipconfig", this is what i got :
Ethernet adapter Local Are Connection 4:
IP Address .... : 10.98.xx.xx
...
Ethernet adapter Local Area Connection 3 :
IP Address .... : 172.22.xx.xx
What i want to do is to have 10.98.xx.xx ip in my variable but with my command what i got is 172.22.xx.xx
Thank you in advance and excuse my bad english !