VB script to list all entries in HKLM\software\microsoft\windows\currentversion\uninstall

Posted on 2009-02-11
Last Modified: 2012-06-22
I am looking for a vb script that will list all the keys under HKLM\software\microsoft\windows\currentversion\uninstall into an txt file.  Ideally the script would:

1. create an output.txt file
2. list the output of all the keys in the output.txt
3. replace the name of each keywith the "displayname" followed by the "uninstall string" information in the output.txt file
Question by:marmarmat
    LVL 67

    Accepted Solution

    Change F:\Out.txt to whatever you want your filename to be...
    const HKLM = &H80000002
    Dim objReg : Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
    Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
    Dim objOut : Set objOut = objFSO.CreateTextFile("F:\Out.txt")
    strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
    Const DisplayName = "DisplayName" 
    Const UninstallString = "UninstallString"
    objReg.EnumKey HKLM, strKeyPath, arrKeys
    For Each strKey in arrKeys
      On Error Resume Next
      objReg.GetStringValue HKLM,strKeyPath & "\" & strKey,"DisplayName",strValue
      objOut.Write strValue & vbTab
      objReg.GetStringValue HKLM,strKeyPath & "\" & strKey,"UninstallString",strValue
      objOut.WriteLine strValue
      If Err.Number <> 0 Then objOut.WriteLine

    Open in new window


    Author Closing Comment

    Excellent, thanks for the information.  This is exactly what I was looking for.
    LVL 67

    Expert Comment

    Happy to help - thanx for the grade! :^)

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Unlike scripting languages such as C# where a semi-colon is used to indicate the end of a command, Microsoft's VBScript language relies on line breaks to determine when a command begins and ends. As you can imagine, this quickly results in messy cod…
    In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now