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

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
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

sirbountyConnect With a Mentor Commented:
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

marmarmatAuthor Commented:
Excellent, thanks for the information.  This is exactly what I was looking for.
Happy to help - thanx for the grade! :^)
All Courses

From novice to tech pro — start learning today.