We help IT Professionals succeed at work.
Get Started

How to remove only the IP Addres from the IPCONFIG command in DOS

536 Views
Last Modified: 2012-05-11
I have a simple question with an even simpler answer. When I run the IPCONFIG command from dos it displays the IP amongst other things. I would like to pipe (>) JUST THE IP TO A .txt FILE. I do not want the whole " Address. . . . . . . . . . . . : 123.123.123.123" line.

::This will perform the IPCONFIG command and send the output to c:\ip.txt
IPCONFIG > c:\ip.txt
Note that the following different display scenarios needs to be catered for as found in ip.txt:
IPv4 Address. . . . . . . . . . . : 192.168.1.103
IP Address. . . . . . . . . . . . : 192.168.1.103
IPv4 Address. . . . . . . . . . . : 1.1.1.1
IP Address. . . . . . . . . . . . : 1.1.1.1

If this can be performed with a simple vbscript that will also be acceptable. Please note however that "first prize" would be pure dos bat commands.
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 2 Answers and 11 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE