Click here to Skip to main content
12,296,188 members (66,093 online)
Click here to Skip to main content
Add your own
alternative version

Stats

17.7K views
248 downloads
23 bookmarked
Posted

Start Menu Cleaner .NET

, 22 Mar 2009 Ms-PL
Rate this:
Please Sign up or sign in to vote.
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. Smile | :)

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 Wink | ;)

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. Wink | ;)

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)

Share

About the Author

Jayson Ragasa
Founder Capploud
Philippines Philippines
I am an experienced Applications Developer and had worked professionally for over 6 years. I have been writing codes and building different applications for over 13+ years. My work is mostly for Microsoft technologies such as .NET. Yes I am Microsoft technology enthusiast.

My field of expertise in .NET technology are Desktop and Windows Mobile and Windows Phone. I occasionally write ASP.NET too for clients.

I have wide experience of different programming languages and scripts such as: Turbo Pascal, Batch Scripts, C/C++, Visual Basic Classic, Visual Basic .NET, Java, HTML, CSS, ASP Classic, VB Script, ASP.NET, T-SQL, MySQL, PHP, C#, Javascript, jQuery, HTML5, RegEx, XAML, XML, JSON, and XPath

I am also experienced in different platforms such as: Google Data API, Google Map API, Twitter API, Facebook API, Flickr API, Skydrive API, SVN, GitHub, Drupal, and Orchard.

I am interested in Microsoft technologies, User Experience and User Interfaces, Algorithms, Robotics, Astronomy, Architecture, Electrical, Mechanics, and Extra Therestrial Life on other planets.

I am also offering free coding and application development consultations with students having a problem with their Thesis projects.

View my full Curriculum Vitae here
http://ss.jaysonragasa.net/?mycv

You may also be interested in...

Comments and Discussions

 
Generalif you convert to .NET 4.0 and use wshom.ocx in /.../System32 ... [modified] Pin
BillWoodruff11-Jun-11 18:41
memberBillWoodruff11-Jun-11 18:41 
GeneralMy vote of 5 Pin
submarelime26-Jul-10 19:06
membersubmarelime26-Jul-10 19:06 
Generalcool tool Pin
Donsw10-Apr-09 7:45
memberDonsw10-Apr-09 7:45 

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

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

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