[AccessD] OT: Detect what Network I'm on

MartyConnelly martyconnelly at shaw.ca
Tue Sep 16 13:28:11 CDT 2003


WMI API should have it. Installed on WinXP and Win2000, have to install 
from MS for Win9x
Windows Management Instrumentation, You could hunt around here for 
sample code.

http://www.activxperts.com/activmonitor/windowsmanagement/wmisamples/


example
The Win32_NetworkClient WMI class represents a network client on a 
Windows system. Any computer system on the network with a client 
relationship to the system is a descendent (or member) of this class 
(for example, a computer running Windows 2000 Workstation or Windows 98 
that is part of a Windows 2000 domain).

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from 
Win32_NetworkClient",,48)
For Each objItem in colItems
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "InstallDate: " & objItem.InstallDate
    Wscript.Echo "Manufacturer: " & objItem.Manufacturer
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Status: " & objItem.Status
Next

John Skolits wrote:

>I need to be able to detect the name of what local network I am on. 
>
>
>Anyone have an API call for this?
>
>John Skolits
>
>
>  
>




More information about the AccessD mailing list