Toggle your wireless card with Autohotkey (Win XP)

Ok, people, this one is a bit more involved.

Start off at

1. Read this part, and do what they say:

Download DevCon package from by clicking here and extract the package and copy the appropriate version (file in I386 folder for 32 bit Windows or file in Ia64 folder for 64 bit windows) to the C:\windows\system32\ folder.

2. Skip the step entited “Determining Device Instance ID.” There is an easier way than theirs. (If mine doesn’t work, then use theirs.) Go to control panel, then system, then device manager, then find your wireless card under Network adapters. Double click on your device, and click on the “details” tab. Choose Device Instance Id from the scrollbox. Here you will see something that looks like this:


Your prolly won’t look exactly like mine. I have bolded the part that matters. Copy that part–whatever it is. Don’t include the &s.


3. Create a new Autohotkey script. (NOOBS: Install Autohotkey. go and get it done. Create and save a new script. (To learn how to create your first script, start here).


Here’s what my script looks like:


#1::Run devcon enable *DEV_4220*

#2::Run devcon disable *DEV_4220*

Note the asterisks–put them in. Save your script, and then make sure your script is running. In my script above, pressing Windows key and 1 turns on my wireless card, and pressing Windows key and 2 turns off my wireless card.

I don’t need to use the command line now to toggle my wireless card. Also, no more clicking through menus! This is helpful when I want to extend my laptop’s battery life and I don’t need or don’t have WiFi access.

-MC Spanky McGee

Spanky’s fav Autohotkey codes, part 2

On my aging Dell laptop, they provided a special “internet key”–it launched a browser when I first got the system. It’s akin to these guys in the silver oval:


But, as the user reinstalls Windows (over and over and over), this internet key becomes worthless. I don’t know why this happens exactly, but it’s obvious that the new installation doesn’t assign the same function to the key.

Using the kickass program, Autohotkey, we can restore its browser-launching capabilities.

1. Install Autohotkey. If you haven’t already, you’re an idiot. Just kidding. go and get it done.

2. Create and save a new script. (If you’re a noob, start here)

3. Follow these directions from their help file, with the subheading “List of Keys, Mouse Buttons, and Joystick Controls”:

If your keyboard or mouse has a key not listed above, you might still be able to make it a hotkey by using the following steps (requires Windows XP/2000/NT or later):

Ensure that at least one script is running that is using the keyboard hook. You can tell if a script has the keyboard hook by opening its main window and selecting “View->Key history” from the menu bar.
Double-click that script’s tray icon to open its main window.
Press one of the “mystery keys” on your keyboard.
Select the menu item “View->Key history”
Scroll down to the bottom of the page. Somewhere near the bottom are the key-down and key-up events for your key. NOTE: Some keys do not generate events and thus will not be visible here. If this is the case, you cannot directly make that particular key a hotkey because your keyboard driver or hardware handles it at a level too low for AutoHotkey to access. For possible solutions, see further below.
If your key is detectible, make a note of the 3-digit hexadecimal value in the second column of the list (e.g. 159).
To define this key as a hotkey, follow this example:
SC159:: ; Replace 159 with your key’s value.
MsgBox, %A_ThisHotKey% was pressed.

Ok, once you’ve done all that,you can now write a script to launch a browser. You can use mine:

Run C:\Program Files\Mozilla Firefox\firefox.exe
WinWait, My Yahoo!,
IfWinNotActive, My Yahoo!, , WinActivate, My Yahoo!
WinWaitActive, My Yahoo!,
WinMaximize, My Yahoo!

SC101 is the name of my Dell Inspiron 5150′s internet key–the name of your key might be different. The above script starts Firefox and activates it for me. One button press, baby, one press.

Of course, you should have all sorts of combos going in Autohotkey, but this is a good start. If you put in some time on the front end with Autohotkey’s learning curve, it will pay big dividends in the end.

Peace out, Napoleon.

-MC Spanky McGee

Spanky’s fav Autohotkey codes: part 1.

Yeah, I’m a total dork for this, but I LOOOOVE Autohotkey. It’s a program that allows you to set up shortcuts for practically anything in Windows.

Download Autohotkey from

and learn how to write your first script. Here’s a good code to start:

IfWinNotActive, Soupy Trumpet, , WinActivate, Soupy Trumpet
WinWaitActive, Soupy Trumpet

The above bit of code opens a browser to when you hold the Windows key and push s. That’s pretty damned cool.


Need to close multiple windows of Firefox in a hurry? Try

SetTitleMatchMode 2
GroupAdd, Firefox, Firefox
WinKill, ahk_group Firefox

Windows key, shift and delete will close all the open Firefox windows for you–ya know, just in case in you’re about to get busted…

-MC Spanks

PS. Do a search at for some cool Autohotkey uses.