A not so very old code submission on CodePlex, it was popular there and already got some reviews on the other site, so I thought of adding it here too. :)
Here's the screen shot, and I intentionally renamed the target files from those shortcuts for the demo since I accidentally deleted them all using that utility I made. I forgot to write the condition where it deletes only the checked items .. but don't worry, that was already fixed ;)
And another one from Windows Vista:
I came across a problem again (I'm a "When there's a problem, I make the solution" guy) where I used a tool WinStep Start Menu Organizer to manage my programs in start menu, and I organize them the way I can easily open them (e.g. my Visual Studio and other Software development programs are in Developer Tools folder) instead of having my programs scattered or sorted and viewed on a 2 or more columns of installed programs.. Yuck! That's a great tool by the way ... BUT!!
Talk about CONS from that tool.. Since I managed them so perfect, the problem sets in when I started to uninstall lots of my unused applications. Why, what is that? You could guess ... DEAD SHORTCUT LINKS! Their Uninstaller left a dead shortcut files in my start menu, because the uninstaller didn't find them and just left them there. Well it's a user's fault. ;)
So just to save my time tracking down those dead shortcuts, I wrote a small utility, an open source and free for all program. Since it grows a bit, I also added a feature to scan empty folders.
Using the Code
Just download the latest release, extract it, and run StartProgramCleaner.exe.
Some code that you might be interested in here is, I used
IWshRuntimeLibrary for handling shortcut files, such as getting the Target Path or Description from the shortcut file.
IWshRuntimeLibrary can be found in Windows Script Host Object Model (C:\Windows\System32\wshom.ocx).
Just reference it and use it:
Here's a little code snippet on how to do it:
private static string GetTarget(string shortcut_file)
IWshShortcut shortcut = (IWshShortcut)wsh.CreateShortcut(shortcut_file);
string t = string.Empty;
if (shortcut.TargetPath != string.Empty)
t = shortcut.TargetPath;
shortcut = null;
private static string GetDescription(string shortcut_file)
WshShell shll = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shll.CreateShortcut(shortcut_file);
string d = shortcut.Description;
shortcut = null;
Points of Interest
This is from the latest release (which is Release 2).
I didn't know this was working fine in Vista or 7 until I saw some reviews on the internet! Thanks guys! and Thanks to that JUNCTION FOLDERS!
- 22nd March, 2009: Initial post