Page 1 of 1

PostPosted: Thu Aug 19, 2010 10:12 am
by Neosoft Support
Basically all the function does is run a Windows utility called "ipconfig" output the results to a text file which is then parsed. The incorrect results look like a problem with the parsing.

You could do something similar without VBScript by using NeoBook's Run action to execute ipconfig and parsing the results yourself.

PostPosted: Fri Oct 01, 2010 10:13 pm
by Tony Kroos
it is not a parsing problem. your computer has many network "ip-enabled" system devices with different parameters, you just need to pick the right one. try this function:

Code: Select all
On Error Resume Next
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
    ("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
For Each IPConfig in IPConfigSet
    If Not IsNull(IPConfig.IPAddress) Then
        IPAddr = Filter(IPConfig.IPAddress, ":", False, 1)
        nbSetVar "[IP]", IPAddr(0)
    End If
Next


Copy this to neobook function editor as VBScript, save and call. Ip will be stored in [IP] variable. In case of any errors [IP] will be empty.

PostPosted: Fri Oct 01, 2010 11:35 pm
by Jay-Bird
Thats a nice tidbit ... Thank you!

PostPosted: Sat Oct 02, 2010 2:51 am
by Tony Kroos
thanks, if you are interested in this I could post more great vbs/js functions for neobook, just ask... :wink: