Coding Horror

programming and human factors

Stupid Registry Tricks

Scott Hanselman's Power User Windows Registry Tweaks has some excellent registry editing tweaks. I've spent the last few hours poring over those registry scripts, enhancing and combining them with some favorites of my own. Here are the results:

My Computer right click menu, after registry tweaks

  • Open Command Window Here

    Adds a right-click menu to all Explorer folders that launches a command prompt window (cmd.exe) at that folder. Incredibly handy.

  • Force Start, Search to search all filetypes

    For some godforsaken reason, Start, Search only searches files with known extension associations by default. I've run into this "feature" before and I nearly pulled my hair out trying to figure out why it couldn't find the source file that I knew was there. This registry fix forces it to search all files, as you would expect. Really a no-brainer.

  • Improve the Disk Cleanup Wizard

    Microsoft added a Disk Cleanup wizard in Windows 98, which all subsequent versions have inherited. It's located at Start, Accessories, System Tools, Disk Cleanup. Unfortunately it kinda sucks. Via the wonders of registry editing, you can change this annoying, useless tool into something that's actually effective:

    • Remove the time-consuming, useless "compress old files" rule
    • Make rules stricter for files in the temporary folder
    • Add rule to check entire disk for temporary files
    • Add rule to remove unnecessary files in Windows folder
    • Add rule to remove debug dump files

    With these changes, I get a first run Disk Cleanup savings of ~11 megabytes on a clean Windows XP install in a VM. Nothing refreshes like giving the Windows undercarriage a little how's your father. If you can think of any other files in a typical Windows install that are completely safe to remove*, let me know, and I can modify the .reg file to incorporate them as well.

    This should probably go without saying, but we are deleting stuff here. Use this at your own risk. For what it's worth, I have used it on several of my machines and inside a VM with excellent results.

  • My Computer right-click menu additions

    Wouldn't it be cool if you could right click My Computer and bring up the registry editor? Or the service manager? Or Add/Remove Programs? With this registry editing batch file, you can. In fact, you can add as many commands to the My Computer right-click menu as you like. Once you try it, you'll wonder why these menu options (see screenshot) aren't there to begin with.

    I changed this script from a plain .reg file to a batch file that calls the REG.EXE command. Why? Because it's far easier to modify this script to taste when you can see the actual right-click command lines as a plain string. For some reason, regedit can only import/export the REG_EXPAND_SZ key as a byte array, even though it's just a basic string with an environment variable in it (eg, %windir%). The alternative is to eschew the use of environment variables entirely and hard-code the windows and folder paths as plain REG_SZ strings.

In the cases where there are a number of modifications to the registry, I also included a copy of the unmodified registry key in the zip file. If you don't like the results, delete the key and re-import the default registry file to get back to square one.

Scott's post has some additional registry tweaks, including one that puts notepad.exe on every right click menu. I prefer to do this using the built in Send To functionality: just put a shortcut to the editor of your choice in the %USERPROFILE%SendTo folder and it will automatically appear in the right-click Send To list for all files. I suppose it is one more click, but I prefer it this way.

* insert LINUX joke here.

Written by Jeff Atwood

Indoor enthusiast. Co-founder of Stack Overflow and Discourse. Disclaimer: I have no idea what I'm talking about. Find me here: http://twitter.com/codinghorror