troubleshooting Question

How do I extract an IP address for an interface from ipconfig /all output?

Avatar of skyfly123
skyfly123 asked on
Windows XPWindows Vista
1 Comment1 Solution333 ViewsLast Modified:
I need to be able to extract the IP address using a batch file from the output of ipconfig /all for the PPP adapter once the connection is live. I tried: for /f "tokens=2 delims=:" %%a in ('"IPCONFIG /all | findstr ppp"') do echo %%a It only finds the line with ppp in it. I need to be able to find the IP assigned to that interface. Under Linux I use: PP_IP="`/sbin/ifconfig ppp0 | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`" Can anyone help me please?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros