How I can resolve the ip of my computer with vbs script ?
Thank's

RE: Resolve Ip by ESP

ESP
Thu Dec 01 15:48:02 CST 2005

These .dlls have worked wonders or me. Just script them into your code.
http://cwashington.netreach.net/main/library/SScrRun.html

ESP




"Dennis" wrote:

> How I can resolve the ip of my computer with vbs script ?
> Thank's
>
>
>

Re: Resolve Ip by \

\
Thu Dec 01 17:03:04 CST 2005

The latest version and documentation are here http://www.netal.com/ssr.htm, but
I don't see any way to read the local computer's IP unless it is a registered
domain. Can you put up a sample script?

Thanks.
--
Crash




Re: Resolve Ip by Groups

Groups
Thu Dec 01 19:56:39 CST 2005

If it's just your local machine as you suggested there are multiple
ways. An easy way is to shell IPCONFIG and read the output. If you
want examples of this method, I would check out this "Tales from the
Script" article on Technet.

http://www.microsoft.com/technet/community/columns/scripts/sg1002.mspx

Michael Reese
http://www.sproik.com/tools.htm


Re: Resolve Ip by \

\
Thu Dec 01 20:44:51 CST 2005

> If it's just your local machine as you suggested there are multiple
> ways. An easy way is to shell IPCONFIG and read the output. If you
> want examples of this method, I would check out this "Tales from the
> Script" article on Technet.

Thanks. I have used ipconfig for that in the past. It is rather awkward,
especially if you are also on a LAN and have two or more IP's associated with
your computer. I was hoping the DLL ESP recommended would provide a more direct
way to read the WAN IP.

I currently use a file on a server:
'--------------------
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://lists.thedatalist.com/myip.php"
do while (IE.busy)
wscript.sleep 1000
loop
IP = IE.document.body.innerText
'--------------------
but that is funky and depends on the permanence and reliability of a remote
system.
--
Crash



Re: Resolve Ip by Groups

Groups
Fri Dec 02 22:11:57 CST 2005

This is another alternative to using IPCONFIG that works for me.

***Watch for word wrap***
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colIPItems = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration " & _
"Where IPEnabled = True")
For Each objitem in colIPItems
For Each objAddress in objitem.IPAddress
Wscript.echo objAddress
Next
Next

Michael Reese
http://www.sproik.com/tools.htm


Re: Resolve Ip by \

\
Sat Dec 03 07:40:38 CST 2005

> This is another alternative to using IPCONFIG that works for me.

Thanks. That still gives me multiple IP's, but it is a lot cleaner than juggling
ipconfig.
--
Crash