Today I started a new job after being out of work for nearly five months. As a part of this job, I've been given a laptop and, like most companies these days, there are both wired and wireless access methods available for the company LAN.
While the access points are secured, the laptops issued to everyone utilize the Windows Wireless Zero Configuration Tool in Windows XP to manage access to the access points in the building. Because I am a task bar minimalist, the ever present icon and information dialogues that appear as a result of connection and disconnection to the access points drive me nuts.
Many current laptops have mechanical switches to enable or disable the WiFi adapter, but the model used by my company is considerably older and predates the widespread deployment of this feature. As such, heretofore, I've always gone into the adapter properties and disabled the WiFi adapter and then followed the same method to enable it the next time I needed it. This process takes two or three clicks and while not difficult, can become cumbersome if you find yourself doing it multiple times during the day.
While taking a break from reading the reams of documentation I've been given, I pondered the question of controlling the adapter hardware via batch script. Lo and behold, Microsoft has created a tool for this very purpose.
The tool is called Devcon and is free to use. It is a command line utility that essentially replaces the GUI Device Manager offered in Windows. There is extensive documentation on it but the important information is thus:
To affect change on a hardware device, you must know its device ID. Devcon provides a function for this called hwids:
c:\>devcon hwids "*" > c:\hardware.txt
This will create a list of all hardware devices currently recognized by Windows along with all pertinent details.