15 June, 2012

Find GUID (Globally Unique Identifier) of installed programs

After a long time, I finally motivated myself and wrote this article. As I spent a couple of hours trying to figure out how to find GUID of Java environment for a little deployment project, I realized that it’s not an easy task if you don’t know where to look. You can probably find a couple of third party applications which can do the job for you. But if you are like me and you don’t want another piece of software sitting on your computer for a one time shot then this article is for you… keep reading…

Get your keyboards ready, we are going to use “PowerShell” or “Command Prompt”. We are going to use WMIC for this task. For more information about WMIC, click on the following link.

By using this command here in “CMD” or “PowerShell” you will get a list of all programs on your computer with their “Globally Unique Identifiers”.

wmic product list

After running this command, it can take a couple of seconds before you see the results so just be patient. Through my tests, the output format of PowerShell is way better than “CMD”. So if you can, stick with “PowerShell”. While this command gives you a summary with enough information on installed programs, you can use the following command to get even more information…

wmic product get

Now, what if you need to print this list? You can print this list into a text file by using the following command.

wmic product get > C:\InstalledPrograms.txt

What can I do with GUID?

GUID is very useful information if you are doing a lot of deployment tasks. Every MSI file has a GUID that we can use in order to reinstall or uninstall these programs. It’s a unique number for a software. This number is the same on every computer in the world. Let’s look at my case to give you an example. I needed to deploy the newest version of Java (Java 7u4). While it’s an easy task to deploy the new version, I had no clue how to uninstall the old version (Java 6u34) which was present on each computer in our network. So I came across with a couple of links that were explaining how to uninstall a program silently from computers with msiexec but it requires you to know and use the GUID of the application that you want to uninstall. I’ll be writing about how to deploy Java through your organization…

How to create a list of all installed programs?

This document was meant to explain issues with GUIDs but you can also use this information in order to create a list of all the installed programs without installing any 3rd party programs.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.