thanks for your answer :)
I plan to run it on laptops computer with on-board WiFi adapters.
I'm not especially interested in any output, only in enabling or
disabling wireless adapters.
maybe oItem.Enable() and/or oItem.Disable() do the trick ?
Pierre
=====================
I have been looking for some time for a method based on WMI to
enable/disable a device, without success. Until I find one I have to use
devcon.exe as in the following batch file. You can get devcon.exe from here:
http://www.yqcomputer.com/
@echo off
goto Start
---------------------------------------------------
Enable or disable a device from the Command Prompt.
Prerequisite: d:\Tools\devcon.exe
16.4.2006 FNL
---------------------------------------------------
:Start
setlocal enabledelayedexpansion
set Adapter=Broadcom NetXtreme Fast Ethernet
if /i "%1"=="enable" goto go
if /i "%1"=="disable" goto go
echo Syntax: Device enable / disable
goto :eof
:go
set HWID=x
set count=0
set found=no
devcon hwids "PCI\*" > c:\device.txt
for /F "tokens=*" %%* in (c:\device.txt) do (
set /a count=!count! + 1
if /i "%%*"=="Name: %Adapter%" set found=yes& set count=1
if !found!==yes if !count!==3 set HWID=%%*
)
if %found%==yes (
echo HWID=!HWID!
devcon %1 "!HWID!"
) else (
echo Device "%Adapter%" not found.
)
endlocal
del c:\device.txt
You would need to adjust the line
set Adapter=Broadcom NetXtreme Fast Ethernet
to suit your own requirements. The adapter name "Broadcom NetXtreme Fast
Ethernet" comes directly from the VB Script that I posted in my first reply.