Utility to list Programs in Add/Remove Programs

I wanted a simple utility to create a list of all programs listed in Add/Remove Programs on my laptop. I searched on net for the utility and got a vbscript code for the same. However I tweaked it to my personal taste. Here is the code:

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)

For Each objItem in colItems
WScript.Echo objItem.Name
Next

Write this code in a text editor and save the file with the extension .vbs. Open command prompt, navigate to the directory where you saved the .vbs file. Type following command :

cscript temp.vbs  > temp2.txt

Open temp2.txt and you will see the list of programs as follows:

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Feedback Tool
Windows Media Player Firefox Plugin
Microsoft Visual Studio 2010 Service Pack 1
Adobe Common File Installer
…..

By default, cscript command displays a logo when the script runs under CScript. The logo, which appears prior to any of the output from the script, looks like this:Microsoft (R) Windows Script Host Version 5.6Copyright (C) Microsoft Corporation 1996-2000. All rights reserved.

You can get rid of the logo using //nologo option as follows:

cscript //nologo temp.vbs  > temp2.txt

Limitation:

This utility lists the programs that were installed using Windows Installer. That was my requirement. You can tweak it to lists programs installed using other installers too.

More about the Win32_Product WMI class is given on MSDN.

Advertisements

One thought on “Utility to list Programs in Add/Remove Programs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s