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!

Retrieve information from registry

Status
Not open for further replies.

LuckyDuck528

Programmer
Dec 21, 2004
65
0
0
US
I'm looking for information/guidance on trying to open the registry and look for the location of a certain .dll to avoid running a search on my whole machine for just the .dll name. Any ideas on what to use or how to accomplish this would be greatly appreciated if it can be done. Not having much luck on goole.

Thanks!
 
is your question relating to where you might find the information in the registry?? or is your question regarding how you would retrieve said information??
 
I'm sorry.
My questions is actually both...
Ultimately I need to

1)Open regedit
2)Search for the *.dll
3)Print the location of the dll on my computer such as(C:\IIS\etc\*.dll)to my excel spreadsheet

Thanks!
 
a wmi query wouldnt be that expensive, you can ask it to return all file objects with .dll, should take too long.
it wouldnt require access to the registry.
i think i am probable talking out of turn but i would guess you would only get info on dll's from the registry if there were registered??? one that is sat in its programs directory wouldnt nec. show up???
 
Here are some snipits that should at least point you in the right direction.

Rgistry
Code:
[COLOR=green]'read the registry w/REGEDIT[/color green]

Dim oWS : Set oWS = CreateObject("WScript.Shell")
oWS.Run "regedit /e /a tempfile.txt  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", 0, true

Excel
Code:
[COLOR=green]' Create and Set up Excel Objects[/color green]

Column = 1
Row = 1
RowErr = 1
Set objXL = WScript.CreateObject("Excel.Application")
'
objXL.Workbooks.Add
objXL.Cells(1,Column).Value = "Hive"
objXL.Cells(1,Column+1).Value = "Path"
objXL.Cells(1,Column+2).Value = "Name"
objXL.Visible = True

You this section in a loop
Code:
Row = Row+1
objXL.Cells(Row,Column).Value = "HIVE name here"
objXL.Cells(Row,Column+1).Value = "path name here" 
objXL.Cells(Row,Column+2).Value = "dll name here"

I just pulled these snipits from some old scripts that I had. Hopefully it will help you.
 
Thank you for the code examples and wmi suggestion. I will work on those today and let you know if anything significant comes out of them!

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top