国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > VBScript > 正文

用vbs列出機(jī)器上所有能調(diào)用的組件

2019-10-26 18:02:01
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
'要用到regtool.ocx,請(qǐng)下載//www.jb51.net/jslib/regtool.ocx,用前請(qǐng)regsvr32   regtool.ocx 

set wshshell = CreateObject("WScript.Shell") 
set registry = CreateObject("regtool.tob") 
'獲取一個(gè)dictionary對(duì)象存儲(chǔ)鍵名 
set dict = CreateObject("Scripting.Dictionary") 
'列舉HKEY_CLASSES_ROOT中所有鍵 
set allkeys = registry.RegEnum("HKCR/") 
'排除所有鍵中鍵名有點(diǎn)的。 
for each key in allkeys 
'第1個(gè)點(diǎn)在哪兒(跳過(guò)初始點(diǎn))? 
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 a 
'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 for 
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) 
'寫信息到記錄文件 
output.WriteLine text 
end sub 
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 青州市| 武穴市| 岚皋县| 潜山县| 新疆| 弥渡县| 永兴县| 乌拉特中旗| 宝山区| 三台县| 汉寿县| 新河县| 云梦县| 玉树县| 泸州市| 固阳县| 义马市| 万安县| 德江县| 精河县| 大丰市| 句容市| 上蔡县| 忻城县| 博罗县| 增城市| 海南省| 江源县| 八宿县| 鄢陵县| 固始县| 福州市| 榆树市| 睢宁县| 察隅县| 江达县| 云梦县| 常德市| 怀化市| 香格里拉县| 临漳县|