PC Review
Forums
Newsgroups
Windows XP
Windows XP WMI
Win32_NetworkAdapterConfiguration, dynamic dial-up ip, static lan
Forums
Newsgroups
Windows XP
Windows XP WMI
Win32_NetworkAdapterConfiguration, dynamic dial-up ip, static lan
![]() |
Win32_NetworkAdapterConfiguration, dynamic dial-up ip, static lan |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I've set my lan connection ip to static, 192.168.0.1. I also have a dial-up
connection to the internet, the ip is dynamic and is assigned by my provider when I connect to the internet. I am trying to find out my dial-up internet address through WMI, but it always returns only my static lan ip! How do I find out my dynamic dial-up IPv4 address through WMI without setting my lan IPv4 address to automatic detection? I need it to stay statically assigned to this lan ip. Here's the script I am using: ----------------------------- Set objWMIService = GetObject("winmgmts:\root\cimv2") Set colFiles = objWMIService.ExecQuery("select IPAddress from Win32_NetworkAdapterConfiguration where Description = 'Realtek RTL8168/8111 Family PCI-E Gigabit Ethernet NIC (NDIS 6.0)'") For Each oInstance In colFiles For Each oProperty In oInstance.Properties_ For Each prop in oInstance.ipaddress if oProperty.name = "IPAddress" then Wscript.Echo oProperty.name & " " & prop end if Next next next ------------------------------------ Always returns 192.168.0.1, drives me nuts! |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Man, you never get any answers on the internet, even such simple questions stay unanswered. Ok, I got it:
------------------------------------------- Const HKEY_LOCAL_MACHINE = &H80000002 strKeyPath = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{72034C6B-26E1-4C2D-9864-B96A57018BD5}" strEntryName = "DhcpIPAddress" Set objReg=GetObject("winmgmts:\\.\root\default:StdRegProv") objReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue Wscript.Echo strValue --------------------------------------------- the CLSID of course depends on the clsid assigned to your adapter "Richard" <WRFan1@gmail.com> schrieb im Newsbeitrag news:3E9AE67B-957D-48EB-89B2-A6E10E51E611@microsoft.com... > I've set my lan connection ip to static, 192.168.0.1. I also have a dial-up > connection to the internet, the ip is dynamic and is assigned by my provider > when I connect to the internet. I am trying to find out my dial-up internet > address through WMI, but it always returns only my static lan ip! How do I > find out my dynamic dial-up IPv4 address through WMI without setting my lan > IPv4 address to automatic detection? I need it to stay statically assigned to > this lan ip. > > Here's the script I am using: > > ----------------------------- > Set objWMIService = GetObject("winmgmts:\root\cimv2") > > Set colFiles = objWMIService.ExecQuery("select IPAddress from > Win32_NetworkAdapterConfiguration where Description = 'Realtek RTL8168/8111 > Family PCI-E Gigabit Ethernet NIC (NDIS 6.0)'") > > > For Each oInstance In colFiles > > For Each oProperty In oInstance.Properties_ > > For Each prop in oInstance.ipaddress > > if oProperty.name = "IPAddress" then > Wscript.Echo oProperty.name & " " & prop > end if > > Next > > next > next > > ------------------------------------ > > Always returns 192.168.0.1, drives me nuts! |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

