slayer199
asked on
Find Local IP in batch file
This is the only section of the script that doesn't work. It does pull the IP, but it outputs the IP with a leading space which kills the rest of my script.
Ex.
192.168.1.100
When it needs to be
192.168.1.100
What am I doing wrong here? The rest of my script works well.
Ex.
192.168.1.100
When it needs to be
192.168.1.100
What am I doing wrong here? The rest of my script works well.
::discover the local IP
:LOCALIP
for /f "tokens=2* delims=:" %%a in ('ipconfig ^| find "IP Address"') do set LOCALIP=%%a
echo %localip%
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER