I need a way to "cut the power" of my WLan device.
Currently I use a PowerShell script to disable the network interface, but I'm not sure if this also really stops the device from scanning and so on. If its possible I'd like to implement this with C++ or C# via WinAPI/WMI.
开发者_Python百科Current PowerShell Script:
$WLanDeviceID = 11
$WLanAdapter = gwmi Win32_NetworkAdapter | Where-Object {$_.DeviceID -eq $WLanDeviceID}
if ($WLanAdapter.NetEnabled) {
$WLanAdapter.Disable()
} else {
$WLanAdapter.Enable()
}
Hardware and Software I'm using:
Windows 7 Visual Studio 2010 Dell Wireless 1397 WLAN Mini-Card (seems to be a Broadcom BCM94312HMG)You can do this using the Dell Client Configuration Toolkit (CCTK), or possibly with the Dell OpenManage Client Instrumentation (OMCI). The CCTK is a command-line utility that gives you control over Dell BIOS options, and the OMCI is a WMI provider that allows you to plug into Dell-specific hardware management controls that you otherwise couldn't access.
I'd recommend looking at either of these tools to accomplish your task from PowerShell.
Sadly there seems to be no possibility to actually "power off" the wireless device :/
精彩评论