How do I get the IP address into a batch-file variable? – Stack Overflow
Posted by jpluimers on 2018/11/13
Since ping has a more predictible output over Windows versions than ipconfig, I use this in a batch file:
for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set NetworkIP=%%a
echo Network IP: %NetworkIP%
Source: [WayBack] How do I get the IP address into a batch-file variable? – Stack Overflow
–jeroen






Leave a comment