We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

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

marmarmat
marmarmat asked
on
Medium Priority
1,028 Views
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
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2007
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
Next
 
objOut.Close

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Excellent, thanks for the information.  This is exactly what I was looking for.
CERTIFIED EXPERT
Top Expert 2007

Commented:
Happy to help - thanx for the grade! :^)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.