Jump to content

IP Address parsing the first three octets.


Falcon1
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • Moderators

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))

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...