views:

34

answers:

1

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.

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)

+1  A: 

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.

Trevor Sullivan
Tried both. As you mentioned they only change the BIOS parameters which means changing the power settings there would only work on the next reboot :/
Strayer