Solved

List installed software on remote computer using registry.

Posted on 2004-10-12
12
341 Views
Last Modified: 2008-02-01
Hi,

I've already done much as I can list all the data on my computer but I.m confused on how to use RegConnectRegistry and sent it to RegEnumEx or should I open using RegOpenEx?...

THanks for your help!

-Jonthemoon
0
Comment
Question by:Jonthemoon
12 Comments
 
LVL 3

Author Comment

by:Jonthemoon
ID: 12287084
I've finally connected to the remote computer but it's giving me only some info and not all...
Why is that??
 
I'me using that. :

RegConnectRegistry "\\PCZ00100", hKey, TKey2
RegOpenKeyEx TKey2, strPath, 0, KEY_ALL_ACCESS, TKey
   
    Do
        StrBuff = String(255, vbNullChar)
        If RegEnumKeyEx(TKey, Cnt, StrBuff, 255, 0, vbNullString, 0, ByVal 0&) <> 0 Then Exit Do
        Cnt = Cnt + 1
        StrKey = Left(StrBuff, InStr(StrBuff, vbNullChar) - 1)
        ReDim Preserve sKeys(Cnt)
        sKeys(Cnt) = StrKey
    Loop
0
 
LVL 9

Expert Comment

by:Shahid Thaika
ID: 12288268
Maybe you don't have permission to see all the data on the other person's computer!
0
 
LVL 3

Author Comment

by:Jonthemoon
ID: 12288416
eeshahidt,
We're on the intranet and I've tried as a user in the administrator group and it doesn't work.
I also tried to connect on to my computer from another one with my credentials and it still don't work.

Anyone has a hint?

-Jonthemoon
0
 
LVL 16

Expert Comment

by:jimbobmcgee
ID: 12288746
What values is it returning;  what is it not returning?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 3

Author Comment

by:Jonthemoon
ID: 12291918
It is returning some applications like Winzip, Windows Fixes, etc. But on 2 PC tested it didn't return MS Office XP.

-JTM
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12293637
It's a lot easier to do this using WMI.
0
 
LVL 3

Author Comment

by:Jonthemoon
ID: 12295712
Do you have a script using WMI??

Thx
JTM
0
 
LVL 76

Accepted Solution

by:
David Lee earned 300 total points
ID: 12296111
The code below, generated by Microsoft's Scriptomatic tool, will get you a list of all software installed on a computer via Microsoft's MSI service.  But it may miss a few things if they didn't use MSI.  Here's a link (http://www.devx.com/GetHelpOn/10MinuteSolution/16914/0/page/2) to an article that describes this and offers code, in Listing 1, that purports to get everything.  The code presented in that article is straight VB, not VBScript.  It should be relatively simple to convert it to VBScript though.  

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)
For Each objItem in colItems
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "IdentifyingNumber: " & objItem.IdentifyingNumber
    Wscript.Echo "InstallDate: " & objItem.InstallDate
    Wscript.Echo "InstallLocation: " & objItem.InstallLocation
    Wscript.Echo "InstallState: " & objItem.InstallState
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "PackageCache: " & objItem.PackageCache
    Wscript.Echo "SKUNumber: " & objItem.SKUNumber
    Wscript.Echo "Vendor: " & objItem.Vendor
    Wscript.Echo "Version: " & objItem.Version
Next
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12296281
Here's the link (http://www.microsoft.com/technet/scriptcenter/default.mspx) to the Microsoft Scripting web site.  Scriptomatic is located about 3/4 of the way down the page under Scripting Tools and Utilities.  However, when I click on that link I get sent back to the Scripting page, not to the Scriptomatic page.  Same thing for all four of the links there.  Maybe it'll work for you.  I've sent an email of to Microsoft advising them of the problem.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now