Jump to content
Sign in to follow this  
Falcon1

IP Address parsing the first three octets.

Recommended Posts

Falcon1

Trying to extract the IP Address using IPCONFIG /ALL and Piping it to ipconfig.txt.

RunWait(@Comspec & " /c ipconfig /all > " & "C:\utils\ipconfig.txt")

How would I get the IP ADDRESS and then get the first three octets?

Thank you for your help.

Share this post


Link to post
Share on other sites
UEZ

I would suggest to use WMI instead ipconfig because of different languages which cause different outputs and WMI is easier to use.

You don't need to parse the text file.

Further which ip address you want to get? On which interface?

Have a look to the macros @IPAddress1 - @IPAddress4, too.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
JLogan3o13

I would agree with UEZ, you should be able to do something simple without outputting to a file. This works for me:

MsgBox(0, "", StringTrimRight(@IPAddress1, 4))

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×