September 11, 2005
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:
- 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.
Posted by Jeff Atwood
Neat tricks - I like the My Computer reg tweak, thanks for sharing. One comment: the Add/Remove Programs failed on my system, due to the slash in the name. I fixed this manually but you may want to update the downloadable zip file.
I love registry hacks, thanks Jeff!
For those of you who like the enhanced right click on my computer, check out this thread over on neowin - a href="http://www.neowin.net/forum/index.php?showtopic=224324"http://www.neowin.net/forum/index.php?showtopic=224324/a - a wacky amount of desktop icons with cool right click menus available. Lots and lots of replies to the tread but as far as I can tell the original poster keeps the first thread updated.
After applying the Disk Cleanup fix, all my Office programs are repairing themselves when I start them.
So is Visual Studio.Net.
It's a "Please wait while Windows configures ..." message, so perhaps it's specifically Windows Installer?
I know what that is. Check your event log:
The resource 'C:\Documents and Settings\All Users\Application Data\Microsoft\Office\Data\DATA.BAK' does not exist.
I "fixed" this by copying the data.dat file to data.bak in that folder.
Clearly, *.bak is not safe to delete in this folder. Sigh. Leave it to MS to use a .bak file as a required filetype..
It doesn't look like you changed the contents of ImproveDiskCleanup.zip.
So is that rename a one-time fix I make? Or would I have to do that after every disk cleanup?
Having trouble deleting a "name" of a file in Windows Media Player. The file itself is gone, but the name is still there. I did an upgrade to Windows Meida Player 10, thinking that would help, but it is still there. Can you tell me how I can get rid of this? It is just annoying. Thanks in advance.
Is there a way to stop the improved clean up from deleting that particular data.bak file?
On this particular machine the file is OPA11.da and .bak.
Win XP home with MSOffice Basic edition 2003 SP1
Windows XP tweaks woul be useful too!
After applying the Disk Cleanup fix, all the Office programs are repairing themselves when I start them.
copy 'C:\Documents and Settings\All Users\Application Data\Microsoft\Office\Data\data.dat' (or another .dat file if you have another version of office) to data.bak.
You have to do that every time after you have used Disk Cleanup.
You can also make a batch file.
1. open Notepad
2. Paste the folowing text:
echo Repair Office after DiskCleanup
echo Press any key to repair Office.
copy "C:\Documents and Settings\All Users\Application Data\Microsoft\Office\Data\*.dat" "C:\Documents and Settings\All Users\Application Data\Microsoft\Office\Data\*.bak"
echo Office is repaired.
3. Go to File == Save As..
4. Choose "All Files" in the "Save as type" box.
5. Type "Repair Office.bat" in the "Filename" box.
6. Run this file every time after Disk Cleanup.
Couldn't import the files.
Thank you Gert for the Office repair fix. It works GREAT!
I installed Microsoft's official 514 kB XP PowerToy Open Command Window Here (CmdHere.exe), and it's defective. Occasionally, it will fail outright, and frequently it displays bizarre errors, i.e. a new cmd window with:
The system cannot find the path specified.
The system cannot find the path specified.
Clearly it works, but it throws up two errors in the process. For some reason, Microsoft's attempt uses:
cmd.exe /k cd %L
cmd.exe /k cd %1
Which works the way it is supposed to. Microsoft require a 514 kB executable to do nothing other than add a wrong entry to the Registry that I could have done correctly by hand (and had done for Win2k on my old PC).
(My only mistake was not realisng I had to use HKCR\Directory instead of HKCR\Folder (File Folder vs Folder, to use Microsoft's alternative and equally confusing notation), which could trigger Explorer crashes if you mistakenly used it on the Recycle Bin.)