Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - IP Address

Reply
 
Old 08-04-2009   #1 (permalink)
James


 
 

IP Address

I want to retrieve the IP address of the machine running my script. I need
a how to, or better yet a good resource that has a list off all the
functions for vbscript listed in a nice understandable order....any help
would be great!

Thanks in advance.

James



My System SpecsSystem Spec
Old 08-04-2009   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: IP Address

James wrote:
Quote:

>I want to retrieve the IP address of the machine running my script. I need
>a how to, or better yet a good resource that has a list off all the
>functions for vbscript listed in a nice understandable order....any help
>would be great!
>
Most clients today (from Windows 2000 on) can use WMI to retrieve the IP
addresses of the local computer. See this link from the Script Center:

http://www.microsoft.com/technet/scr.../nwlsvb01.mspx

For VBScript functions download the WSH documentation:

http://www.microsoft.com/downloads/d...displaylang=en

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Old 08-05-2009   #3 (permalink)
James


 
 

Re: IP Address

Thanks again Richard. Here is what I found if anyone wants to use it...

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set IPConfigSet = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")

For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
'WScript.Echo IPConfig.IPAddress(i)
msgbox IPconfig.IPAddress(i),0,"IP Address"
Next
End If
Next

James

"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in
message news:%23SJr2LSFKHA.4932@xxxxxx
Quote:

> James wrote:
>
Quote:

>>I want to retrieve the IP address of the machine running my script. I
>>need a how to, or better yet a good resource that has a list off all the
>>functions for vbscript listed in a nice understandable order....any help
>>would be great!
>>
>
> Most clients today (from Windows 2000 on) can use WMI to retrieve the IP
> addresses of the local computer. See this link from the Script Center:
>
> http://www.microsoft.com/technet/scr.../nwlsvb01.mspx
>
> For VBScript functions download the WSH documentation:
>
> http://www.microsoft.com/downloads/d...displaylang=en
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
How to eliminate invalid e-mail address from address book Vista mail
Can i migrate/associate http://mynick.spaces.live.com/ web address with my new email address??? Live Messenger
setting for replies: receiver address - not default address Vista mail
Help me --Hyper link address.. doesnt take me.. to article (web address) in Window Vista 32 Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46