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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listing Installed Software List In Computer 1

Status
Not open for further replies.

AceJet

IS-IT--Management
May 10, 2001
12
MY
Hii guys,

I need to get a list of installed software in a computer to generate a report in VB. Is there anyone know how to get the installed software using VB. Please help.....
 
look at wmi - has class for installed software.

Beware though this sometimes does not list all installed software (in my case it missed some import apps out), so i resorted to drilling through the registry to pick up the keys that are used by the ADD/Remove programs control panel

Jamie Gillespie
Senior IT Technician
South Cheshire College
j-gillespie@s-cheshire.ac.uk
 
Welcome to Tek-Tips, AceJet

To get the best from the forum, read faq222-2244 carefully.

For this question, a quick search on this forum, using the keyword search tab, shows several approaches to this including:
thread222-522146

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Thank's JGillespie, but where can I get the wsi and how to associate it into VB ?
 
heres the WMI script:

Set oLocator=CreateObject("WbemScripting.SWbemLocator")

strNamespace="root\cimv2"
strPC=Inputbox("Enter a computername to query. DO NOT ENTER THE LOCAL COMPUTER NAME!!!")
strUser=""
strPassword=""
Set oSvc=oLocator.ConnectServer(strPC,strNamespace,strUser,strPassword)

for each prod in oSvc.InstancesOf("Win32_Product")
strYr=Left(prod.InstallDate,4)
strMo=Mid(prod.InstallDate,5,2)
strDy=Right(prod.InstallDate,2)
strInstalled=strMo&"/"&strDy&"/"&strYr

msgbox strPC & "," & prod.Name & "," & prod.Vendor & _
"," & prod.Version & "," & strInstalled & "," & DATE
Next


set oSvc=Nothing
set oLocator=Nothing


and heres the registry one:

Dim refRegistry
Const HKEY_LOCAL_MACHINE = &H80000002

Set fso = CreateObject("Scripting.FileSystemObject")
Set fil = fso.CreateTextFile("c:\Test_Installed.txt",True)


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

Set WshShell = WScript.CreateObject("WScript.Shell")

Set refRegistry = getobject("winmgmts:\root\default:stdregprov")

Enumerate "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",refRegistry,0

Set refRegistry = Nothing

'recursive subroutine call
Sub Enumerate(strKey,refRegistry,numLevel)
Dim arrSubKeys
Dim strSubKey
Dim strIndent
Dim i
'prefix output with correct indentation level
strIndent = ""
For i = 0 To numLevel
strIndent = strIndent + " "
Next

'display output
'WScript.Echo strIndent & strKey
'enumerate any subkeys
If refRegistry.EnumKey( _
HKEY_LOCAL_MACHINE, strKey, arrSubKeys) = 0 Then
For Each strSubKey In arrSubKeys
'recursively call ourselves


On Error Resume Next
'WScript.Echo WshShell.RegRead("HKLM\" & strKey & "\" & strSubKey & "\DisplayName")
fil.WriteLine(WshShell.RegRead("HKLM\" & strKey & "\" & strSubKey & "\DisplayName"))

'txt = txt & WshShell.RegRead("HKLM\" & strKey & "\" & strSubKey & "\DisplayName") & vbcrlf
'WScript.Echo strSubKey
Next
Else
'WScript.Echo "Unable to enumerate. Sorry."
'WScript.Quit
End If

Jamie Gillespie
Senior IT Technician
South Cheshire College
j-gillespie@s-cheshire.ac.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top