Life of a techno-guru
Tuesday, June 13, 2006
  Script to find ProgID's Registered with the local COM server
Here's a script I wrote up quickly tonight that grabs all the registered COM objects with ProgID's and outputs it to comma-delimited text. Basically, what I do with it, since I was way too lazy (hey, I had other things going on too :-) to use a Scripting.FileSystemObject is to run it from the command line using cscript.exe and use the ">" to redirect to a file. Here's an example from the command line:

cscript findProgIDs.vbs > progIDs.csv

Then remove the first couple lines from the text document, and open the CSV file with OpenOffice Calc. Select columns A and B, goto Data -->
Sort --> OK, and voila! You now have a list of COM objects, complete with both ProgID and VersionIndependentProgID pulled fresh from your local computer's registry! Now, as for what you can do with these, I have absolutely no idea, but this is at least a start :) Here's what I do: find something that sounds interesting that you'd want to script with (I chose Microsoft.Update.ServiceManager), goto Google, type in the name of the COM object, and see if anyone has examples or documentation on how to use it. Anyway, hopefully this helps someone out or puts some new ideas in someone's mind .... just throwing it out there for fun. You never know what you can find ... maybe even a script that prints out a PDF document without taking the steps of opening it up and choosing print? Until next time ...

EDIT: Here's a link I found to some documentation on using the Windows Update API

on error resume next
subkey = "CLSID"
const HKEY_CLASSES_ROOT = 2147483648
set objWMI = GetObject("winmgmts:root\default:StdRegProv")

objWMI.EnumKey HKEY_CLASSES_ROOT, subkey, keys

for each key in keys
skey = subkey & "\" & key & "\ProgID"
svkey = subkey & "\" & key & "\VersionIndependentProgID"
objWMI.GetStringValue HKEY_CLASSES_ROOT, skey, "", ProgID
objWMI.GetStringValue HKEY_CLASSES_ROOT, svkey, "", IProgID
if ProgID <> "" and IProgID = "" then
wscript.echo ProgID
elseif ProgID <> "" and IProgID <> "" then
wscript.echo ProgID & "," & IProgID
end if
next
 
Comments: Post a Comment



<< Home
My life of learning various things about technology including network administration, development, and 3D design

Name:
Location: Chicago, Illinois, United States
ARCHIVES
January 2006 / February 2006 / March 2006 / May 2006 / June 2006 / July 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / January 2007 / February 2007 / March 2007 / April 2007 / May 2007 / June 2007 / August 2007 / December 2007 / January 2008 / March 2008 / April 2008 / June 2008 / July 2008 / September 2008 / December 2008 / January 2009 / February 2009 / March 2009 / May 2009 /


Powered by Blogger