Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to list all installed programs on a pc.

Status
Not open for further replies.

simdan42

Programmer
Jul 17, 2002
118
0
0
US
I need to write a script that will list all of the programs installed on a pc. Any idea where this info is stored?
 
The "Scripting Guys" have a great lady, who specificly delt with ugly output. All of the Week #2 scripts are available for download.

I like and respect Belarc Advisor, but I am not convinced it answered the original posters's question.
 
I need something that I can run in the login script that will save the list of programs on a network drive.
 
Just in case you are wondering, here is what I did.
------------------------------------------------------------

Dim strUserName, strCompName, strLocation


SET WSHShell = CreateObject("WScript.Shell")

strUserName = WSHShell.ExpandEnvironmentStrings("%USERNAME%")
strCompName = WSHShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
strLocation = "PATH GOES HERE" + strUserName + "-" + strCompName + ".txt"

Dim strComputer, strKey, strSubKey
DIM fso, GuyFile
Dim objRegistry
Dim arrSubKeys()
Dim strDisplayName, strDisplayVersion, strInstallLocation
Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."
strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

' BEGIN CALLOUT A
Set objRegistry = GetObject("winmgmts:" & _
"{impersonationLevel=Impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
' END CALLOUT A

' BEGIN CALLOUT B
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKey,
arrSubKeys
' END CALLOUT B

' BEGIN CALLOUT C
On Error Resume Next
For Each strSubKey In arrSubKeys
objRegistry.GetStringValue HKEY_LOCAL_MACHINE, _
strKey & "\" & strSubKey, "DisplayName",
strDisplayName

Set fso = CreateObject("Scripting.FileSystemObject")
Set GuyFile = fso.CreateTextFile(strLocation, True)
GuyFile.WriteLine(strDisplayName)
strDisplayName = vbEmpty
Next
GuyFile.Close
' END CALLOUT C

Msgbox "Update completed successfully"

------------------------------------------------------------

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top