Article ID: 914357 - View products that this article applies to.
IMPORTANT : This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/256986/EN-US/ )Description of the Microsoft Windows Registry
This step-by-step article describes how to enumerate the software products that are installed on a computer by using the My namespace in Microsoft Visual Basic 2005. This article also includes sample code that illustrates the concepts that are discussed.
Note To access certain registry keys on a computer, you may have to have administrative credentials.
RequirementsTo enumerate software products, you must have the following software installed:
Step 1: Create a Console ApplicationTo create a new Console Application project by using Visual Studio 2005, follow these steps:
Step 2: Retrieve a list of installed software productsWARNING : If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
The list of installed software products is located under the following registry subkey:
To access the list of installed software products, open this registry subkey by adding the following sample code to the Main method.
Note This code stores a list of installed software products as a string array in the subkeys variable. The keyname variable is used to display the names of these products in step 3.
Step 3: Output the list of installed software productsTo output the list of installed products, add the following code to the Main method.
The complete code listing for Module1.vb is as follows.
Step 5: Verify that the code works
For more information about the Windows registry, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/aa370338.aspxFor more information about how to access the Windows registry by using the My namespace, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/0wc4y85e(VS.80).aspxFor more information about how to enumerate the software products that are installed on a computer, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/821775/ )How to enumerate the software products that are installed on a computer
Article ID: 914357 - Last Review: January 18, 2007 - Revision: 2.0
Contact us for more help