Jump to content


  • 0
anyweb

how can I get my IP address from WMIC

Question

to do this you need to be using Windows Server 2003, Windows XP or Windows Vista (Windows 2000 doesn't support it)

 

open a command prompt and paste this

 

wmic.exe path win32_NetworkAdapterConfiguration get /format:htable > win32_NetworkAdapterConfiguration.html

 

This will create a new file called win32_NetworkAdapterConfiguration.html which you can open in a Web browser (IE please, Firefox won't render this correctly)

 

here's a sample of the file

 

win32_NetworkAdapterConfiguration.html

 

Under the IPAddress column, you'll see the IP address of the current Network adapter, you may see many listed (PPOE and more)

 

 

here's the same query in text format

 

wmic.exe path win32_NetworkAdapterConfiguration get  > win32_NetworkAdapterConfiguration.txt

 

win32_NetworkAdapterConfiguration.txt

 

as you can see from the samples they not only give the ip address but lots more info like MAC address and so on

 

now, this will only reveal your LOCAL ip address, ie: if you are behind a router (or dhcp server) then that ip is the one it will reveal, so if you want your real WAN (internet or wide area network) ip address then you'll need another script...

 

cheers

anyweb

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.