Talal said:
I would like to generate a list of all software installed on my computer,
and then print that list. Is there an easy way to do that?
Hi
Here is a VBScript that enumerates the keys under the Uninstall key in registry
and shows the result in notepad:
Const OpenAsASCII = 0 ' Opens the file as ASCII (TristateFalse)
Const OpenAsUnicode = -1 ' Opens the file as Unicode (TristateTrue)
Const OpenAsDefault = -2 ' Opens the file using the system default
Const OverwriteIfExist = -1
Const FailIfNotExist = 0
Const ForReading = 1
sComputer = "." ' use . for local computer
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sTmpFile = oShell.ExpandEnvironmentStrings("%TEMP%") & "\" & oFSO.GetTempName
Set fTmpFile = oFSO.CreateTextFile(sTmpFile, _
OverwriteIfExist, OpenAsASCII)
fTmpFile.Write InstalledApplications(sComputer)
fTmpFile.Close
oShell.Run "notepad.exe " & sTmpFile, 1, True
oFSO.DeleteFile sTmpFile
Function InstalledApplications(node)
Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE
Set oRegistry = _
GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& node & "/root/default:StdRegProv")
sBaseKey = _
"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
iRC = oRegistry.EnumKey(HKLM, sBaseKey, arSubKeys)
For Each sKey In arSubKeys
iRC = oRegistry.GetStringValue( _
HKLM, sBaseKey & sKey, "DisplayName", sValue)
If iRC <> 0 Then
oRegistry.GetStringValue _
HKLM, sBaseKey & sKey, "QuietDisplayName", sValue
End If
If sValue <> "" Then
InstalledApplications = _
InstalledApplications & sValue & vbCrLf
End If
Next
End Function