This is a multi-part message in MIME format.
------=_NextPart_000_000A_01C52883.E800CAC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
The following code query the IP address of enabled NIC cards, how do I =
assign the IPConfig.IPAddress(i) to another variable and Echo the output =
later on(not within FOR... EACH... NEXT)?=20
The IPConfig.IPAddress(i) seems like an array, you help is greatly =
appriciated.
Thanks
Frank
strComputer =3D "."
Set objWMIService =3D GetObject("winmgmts:" _
& "{impersonationLevel=3Dimpersonate}!\\" & strComputer & =
"\root\cimv2")
Set IPConfigSet =3D objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where =
IPEnabled=3DTRUE")
=20
For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then=20
For i=3DLBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
WScript.Echo IPConfig.IPAddress(i)
Next
End If
Next
------=_NextPart_000_000A_01C52883.E800CAC0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1491" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The following code query the IP address =
of enabled=20
NIC cards, how do I assign the IPConfig.IPAddress(i) to another variable =
and=20
Echo the output later on(not within FOR... EACH... NEXT)? </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The IPConfig.IPAddress(i) seems like an =
array, you=20
help is greatly appriciated.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Frank</DIV>
<DIV><BR></DIV></FONT>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>strComputer =3D "."<BR>Set =
objWMIService =3D=20
GetObject("winmgmts:" _<BR> &=20
"{impersonationLevel=3Dimpersonate}!\\" & strComputer &=20
"\root\cimv2")<BR><BR>Set IPConfigSet =3D objWMIService.ExecQuery=20
_<BR> ("Select * from =
Win32_NetworkAdapterConfiguration Where=20
IPEnabled=3DTRUE")<BR> <BR>For Each IPConfig in =
IPConfigSet<BR> =20
If Not IsNull(IPConfig.IPAddress) Then=20
<BR> For =
i=3DLBound(IPConfig.IPAddress)=20
to UBound(IPConfig.IPAddress)</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2> &nbs=
p; =20
WScript.Echo =
IPConfig.IPAddress(i)<BR> =20
Next<BR> End If<BR>Next<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> </DIV></FONT></BODY></HTML>
------=_NextPart_000_000A_01C52883.E800CAC0--