Jump to content

Checking for type network adapters


Recommended Posts

My script is running on Windows XP machines of unknown hardware configuration

I am iterating through the Win32_NetworkAdapterConfiguration WMI objects to check the network adapters. I can't find a way to determine if the adapater is a WiFi adapter.

Do I have to iterate through a different set of objects?

I also want to be able to directly launch the properties dialog box of a specific adapter.

I don't want to go through the network connections window.

Any pointers would be great.

I would like a method that can work on SP1 and SP2, but SP2 is more critical.

Link to comment
Share on other sites

My script is running on Windows XP machines of unknown hardware configuration

I am iterating through the Win32_NetworkAdapterConfiguration WMI objects to check the network adapters. I can't find a way to determine if the adapater is a WiFi adapter.

Do I have to iterate through a different set of objects?

I also want to be able to directly launch the properties dialog box of a specific adapter.

I don't want to go through the network connections window.

Use scriptomatic (search forum) to generate the appropriate WMI scripts for AutoIT.

You need this:

\root\WMI MSNdis_80211_Configuration.

This will give you the name (InstanceName) of the WLAN adapters in your system. Use

This name to find the corresponding network adapter configuration with this:

\root\CIMV2 Win32_NetworkAdapter

Compare the previous InstanceName with the Caption to find the WLAN adapter.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Hi,

not what you are looking for, but have a look at : :whistle:

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.1++
; Author: Chaos2
; Script Function:    output basic hardware info
;
; ----------------------------------------------------------------------------

$objWMIService = objget("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")

$colSettings = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
$colMemory = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
$colCPU = $objWMIService.ExecQuery("Select * from CIM_Processor")
$colVideoinfo = $objWMIService.ExecQuery("Select * from Win32_VideoController")
$colSound = $objWMIService.ExecQuery("Select * from Win32_SoundDevice")
$colMouse = $objWMIService.ExecQuery("Select * from Win32_PointingDevice")
$colMonitor = $objWMIService.ExecQuery("Select * from Win32_DesktopMonitor")
$colNIC = $objWMIservice.ExecQuery("Select * from Win32_NetworkAdapter WHERE Netconnectionstatus = 2")
Dim $pcinfo


For $object in $colCPU
    $PcInfo = $pcinfo & StringStripWS($object.Name,1) & @CRLF
Next

For $objOperatingSystem in $colSettings
    $PcInfo = $PcInfo & $objOperatingSystem.Caption & " Build " & $objOperatingSystem.BuildNumber & " Servicepack " & $objOperatingSystem.ServicePackMajorVersion & "." & $objOperatingSystem.ServicePackMinorVersion & @CRLF
    $PcInfo = $PcInfo & "Available Physical Memory: " & String(Int(Number($objOperatingSystem.FreePhysicalMemory) / 1024)) & " Mb" & @CRLF
Next

For $object in $colMemory
    $PcInfo = $PcInfo & "Total Physical Memory: " & String(Int(Number($object.TotalPhysicalMemory) / (1024 * 1024))) & " Mb" & @CRLF
Next

$objFSO = objCreate("Scripting.FileSystemObject")
$colDrives = $objFSO.Drives

$Opticaldrives = "Opticaldrives : "

For $object in $colDrives
    If ($object.DriveType == 2) then
        $PcInfo = $PcInfo & "Total space on : " & $object.DriveLetter & ":\  (" & $object.VolumeName & ")  = " & String(Round((Number($object.TotalSize) / (1024 * 1024 * 1024)),2)) & " Gb" & @CRLF
        $PcInfo = $PcInfo & "Free space on  : " & $object.DriveLetter & ":\  (" & $object.VolumeName & ")  = " & String(Round((Number($object.FreeSpace) / (1024 * 1024 * 1024)),2)) & " Gb" & @CRLF
    Else
        $Opticaldrives = $Opticaldrives & $object.DriveLetter & ":\ "
    EndIf
Next

$PcInfo = $PcInfo & $Opticaldrives & @CRLF

For $object in $colVideoinfo
    $PcInfo = $PcInfo & "Video card: " & $object.Description & @CRLF
Next

For $object in $colSound
    $PcInfo = $PcInfo & "Sound device: " & $object.Description & @CRLF
Next

For $object in $colMouse
    $PcInfo = $PcInfo & "Mouse : " & $object.Description & @CRLF
Next

For $object in $colMonitor
    $PcInfo = $PcInfo & "Monitor : " & $object.Description & @CRLF
Next

For $object in $colNIC
    $Pcinfo = $pcinfo & $object.name & @CRLF
Next
ClipPut( $pcinfo )
MsgBox(48,"PCinfo",$PcInfo)
MsgBox( 48, "PCinfo", "Information was copied to clipboard", 5)

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Use scriptomatic (search forum) to generate the appropriate WMI scripts for AutoIT.

You need this:

\root\WMI MSNdis_80211_Configuration.

This will give you the name (InstanceName) of the WLAN adapters in your system. Use

This name to find the corresponding network adapter configuration with this:

\root\CIMV2 Win32_NetworkAdapter

Compare the previous InstanceName with the Caption to find the WLAN adapter.

Cheers

Kurt

Thanks.

Now I know which objects in my Win32_NetworkAdapter collection are WiFi adapters.

There must be a shortcut to the network properties.

Perhaps a command that takes the SettingID of that adapter as a parameter?

I tried a command like the following but it didn't work

explorer ::{6542665C-A829-45A3-A728-52832557400C}

Any ideas?

The network properties page seems to be run from the explorer process, but I don't know how to look at the process parameters that it was started with to figure out how Windows is doing it.

I bet there's a tool out there that could help, right?

Link to comment
Share on other sites

Hi,

have you tried Devcon.exe. Maybe it could help out. :whistle:

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...