Re: Gathering Workstation IP Address
- From: "Yannick SCHAPPLER" <yannick.schappler@xxxxxxx>
- Date: Sun, 29 Jan 2006 10:45:37 +0100
On my XP computer, the present network cards are located there :
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
You have a list of id for which card you have, select one and look at the
keys named "IP Adress", "Subnet Mask" and "Default Gateway".
In my case I use DHCP, so those keys are empty, you must see the ones named
"Dhcp Ip Adress", "Dhcp Subnet Mask" and "Dhcp Default Gateway"
With a little script you can collect those keys (you must first search for
the correct adapter, and then dump the values), and having your answer.
Yannick SCHAPPLER
France
"Tired Tech" <TiredHATESPAMTech@xxxxxxxxx> a écrit dans le message de news:
TiredHATESPAMTech-D6A69F.01283029012006@xxxxxxxxxxxxxxxxxxx
> After searching through the registry on WinXP, I could not find an ASCII
> reference for IP address. This was such an easy task with WinNT, yet I
> guess it's an encoded value now on WinXP. Anyway, I am using the
> following code to gather IP addresses:
>
> -----
> 'Launch IPCONFIG
> Set ipExec = WSH.Exec("ipconfig.exe")
>
> 'Go to the correct line of returned output from IPCONFIG
> for i = 0 to 6
> ipExec.StdOut.SkipLine
> next
>
> 'Now at the right spot, read the entire line
> strIPinfo = ipExec.StdOut.ReadLine()
>
> 'Gives me the IP address
> strIPinfo = Mid(strIPinfo,45)
> -----
>
> While the above works for me, I was hoping there was an object similar
> to Wscript.Network that already gathers this information. Besides, the
> above code splashes a command window on the screen every so briefly. It
> would be nice to simplify things and remove the command window kludge.
>
> Joe
>
> --
> Tired Tech
.
- Follow-Ups:
- Re: Gathering Workstation IP Address
- From: Tired Tech
- Re: Gathering Workstation IP Address
- References:
- Gathering Workstation IP Address
- From: Tired Tech
- Gathering Workstation IP Address
- Prev by Date: Re: Gathering Persistent Drive Mappings
- Next by Date: Re: Gathering Workstation IP Address
- Previous by thread: Gathering Workstation IP Address
- Next by thread: Re: Gathering Workstation IP Address
- Index(es):