Click here to Skip to main content
Licence Ms-PL
First Posted 22 Mar 2009
Views 10,424
Downloads 114
Bookmarked 23 times

Start Menu Cleaner .NET

By | 22 Mar 2009 | Article
Start Menu Cleaner .NET (fka. Start Menu Cleaner for Windows XP) is a small utility that scans all dead shortcuts and empty folders on your Programs in Start menu. Tested on Windows XP, Vista, and W7

Introduction

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:

Background

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:

using IWshRuntimeLibrary;

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;
   return t;
}

private static string GetDescription(string shortcut_file)
{
   WshShell shll = new WshShell();
   IWshShortcut shortcut = (IWshShortcut)shll.CreateShortcut(shortcut_file);          
   string d = shortcut.Description;
   shortcut = null;
   return d;
}

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!

History

  • 22nd March, 2009: Initial post

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

About the Author

Jayson Ragasa

Founder
Gambit Creative Software
Philippines Philippines

Member

Follow on Twitter Follow on Twitter
Full time Application Developer

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generalif you convert to .NET 4.0 and use wshom.ocx in /.../System32 ... [modified] PinmemberBillWoodruff18:41 11 Jun '11  
GeneralMy vote of 5 Pinmembersubmarelime19:06 26 Jul '10  
Generalcool tool PinmemberDonsw7:45 10 Apr '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 22 Mar 2009
Article Copyright 2009 by Jayson Ragasa
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid