Solved

List installed software on remote computer using registry.

Posted on 2004-10-12
12
342 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 16

Expert Comment

by:jimbobmcgee
ID: 12288746
What values is it returning;  what is it not returning?
0
 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Input past end of file vbs script 9 91
VB error "Type mismatch" 2 53
Put text in a picture ASP.NET C# 2 56
SQL VB connection works in one PC and doesn't in another 15 64
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

815 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

13 Experts available now in Live!

Get 1:1 Help Now