
TCP/IP Address (Windows 2000)
set wmi = getobject("winmgmts:")
wql = "select IPAddress, MACAddress " _
& "from win32_networkadapterconfiguration " _
& "where ipenabled=true"
set results = wmi.execquery(wql)
for each nic in results
msgbox nic.IPAddress(0)
msgbox nic.MACAddress
next
--
Michael Harris
Microsoft.MVP.Scripting
--
Please do not email questions - post them to the newsgroup instead.
--
Quote:
> OK, but Im quite new to VBScripting, so that really doesnt mean much.
> Anymore help will be greatful
> Thanks
> Rich
> > Grab the WMI SDK. Forget about IPCONFIG.
> > > Hi, I need to the IP address from Windows 2000 PC's for a backup script.
> I
> > > cant find an easy way to do this under 2000 so I have called IPCONFIG
> and
> > > redirected it to a file. I need to strip out th IP address from the
> file.
> > > Is there away of searching a file and returning the line if it contains
> a
> > > word, eg address, subnet etc
> > > so far i have used the .skipline around 10 times, to get the IP address,
> > but
> > > is there an easy way of doing this.
> > > Thanks
> > > Richard