ApplicationList: Retrieving a list of installed applications using WMI in C#

There is a need to display a list of installed applications on a remote (or local) computer and in my hour of searching for an example found that no complete c# source existed. I decided to convert the VBscript examples I did find into a simple c# console application and the following code was created. Ideally I would like to know when the application was last used, but for now I’ll just show the application and version. There is also an xml export capability in the sample console application.

The source code can be found here: ApplicationList.zip

Note: You will need to download the command line parsing component I wrote here and reference it in your project for the sample console application to compile.

To use the ApplicationsList class from the project, simply use the following code:

ApplicationsList itemsList = new ApplicationsList(remoteHostName, userName, password);

if (itemsList.ErrorMessage.Length == 0)
{
    foreach (ApplicationItem item in itemsList)
    {
        Console.WriteLine("\t{0}\t{1}", item.Name, item.Version);
        Console.WriteLine("\tApplications");
    }
}

Tags: , ,

Leave a Comment

You must be logged in to post a comment.