Changing a file's Read/Write attribute
OK, there you are, developing your great applications, and you find your self struggling with SourceSafe over and over again. You just want to change a file to see whether this great idea you have can be done, but no sir, you don't want to check a file out! So you go to Explorer, click 'Properties', and remove the ReadOnly attribute, and make your changes without checking the file out. I find myself over and over again doing this, but selecting the properties of a file and changing Read-Only attribute is just a click too much. So here you go, my first extension adds an entry to Explorer's right-click menu, labeled 'RW!', which will just make a file read-write. If you need to go back, just select 'RO!' and it will toggle it back to read-only.
Quickly creating a directory
During a developer's day at work, you find yourself constantly creating folders, and I got tired of the way Explorer forces me to do that. I want it done quick!! Hold on to your horses, here's another extension called 'Make Directory', which needs just a click (and considerably less resources) then creating a folder using the standard Windows Explorer way.
Removing temporary files
After a hard week of work, of course you're going to make a backup, but you first remove files you don't need, like outputs from builds, temporary files, etc.. So search for files you don't want in your backup, but then you need to start a fight with the way Microsoft thinks searching directories should be done. I can't use that: I can't even specify that I only want to find folders, and if it finds something, and I want to perform some action on it, it tells me it can't open the files! Well, what did it find then? Enough of that, another shell extension removes all files/directories as found under HKCU\Software\SDE\SDE Extensions\RemoveJunk:
[HKEY_CURRENT_USER\Software\SDE\SDE Extensions\RemoveJunk]
"Directories"="obj;bin"
"Files"="dlldata.c;*.ncb;*.plg;*.suo;*_i.c;*_p.c"
Upon registration, these default entries are added. When you invoke the 'Remove Junk' Shell-Extension, it will delete all folders specified in the 'Directories'-value, and all files found in the 'Files'-value, and you should find them in the Recycle Bin.
Assigning MP3-files
The last extension is one which might not be of particular use to you, but for me it is. I have a folder called mp3, and besides it several folders for categorizing any MP3s. Each MP3 file I download, I put in a folder called 'Everything'. When I select a file with the extension '.mp3' in this folder, my shell extension will enumerate all directories found besides the 'Everything' directory, and will use them as options for assigning a category to the MP3 file. If choice is made, a hard link is created in that directory pointing to the file selected.
The three pictures I show over here are showing the directory-structure, assigning the category 'Rock' to the MP3 file 'Life - Iris.mp3', and the directory contents of the 'Rock' directory after assigning the category.
Background
The shell-extensions are based on Michael Dunn's excellent article The Complete Idiot's Guide to Writing Shell Extensions.
The code
I document code in the code itself, so just look in the code and I hope the comments you find over there will be enough.
To be continued...
I'm thinking of implementing some 'Search'-utility as a Shell-Extension, what do you guys think?