'To use regtool. ocx, download http://www.jb51.net/jslib/regtool.ocx. before using regsvr32 regtool. ocx
Set wshshell = Createobject ("wscript. Shell ")
Set registry = Createobject ("regtool. TOB ")
'Get a dictionary object storage key name
Set dict = Createobject ("scripting. Dictionary ")
'Enumerate all keys in hkey_classes_root.
Set allkeys = registry. regenum ("hkcr \")
'Exclude all key and key names.
For each key in allkeys
'Where are the 1st points (skip the initial point )?
Pos = instr (2, key ,".")
If POS> 0 then
'There' s a dot. Is there another one?
Pos2 = instr (Pos + 1, key ,".")
If pos2> 0 then
'Yes, so this name is version specific
'Check whether we already have
'Version-independent progid!
Independent = left (Key, pos2-1)
If not dict. exists (independent) then
'No, store it
Dict. Add key, 0
End if
Else
'This one is version-independent.
'Do we already have a version-dependent
'Progid in store?
Vdpid = ""
For each element in dict
If Len (element)> Len (key) then
If left (element, Len (key) + 1) = Key & "." Then
'Yes, return name
Vdpid = Element
Exit
End if
End if
Next
Any Version dependent progid found?
If vdpid = "" then
'No, add to store
Dict. Add key, 0
Else
'Yes, replace
Dict. Remove vdpid
Dict. Add key, 0
End if
End if
End if
Next
Msgbox dict. Count & "objects found! "
For each key in dict
List = List & Key & vbcrlf
Next
Msgbox list
Outputfile = "C: \ object. txt"
Set FS = Createobject ("scripting. FileSystemObject ")
Set output = FS. createtextfile (outputfile, true)
Print dict. Count & "objects found! "
Print list
Output. Close
Wshshell. Run outputfile
Sub print (text)
'Write information to the record file
Output. writeline text
End sub