• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >vbs > 用vbs列出机器上所有能调用的组件

用vbs列出机器上所有能调用的组件

作者: 字体:[增加 减小] 来源:互联网

通过本文主要向大家介绍了vbs组件,如何制作vbs游戏,vbs程序代码,vbs,vbs整人代码等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
'要用到regtool.ocx,请下载http://www.jb51.net/jslib/regtool.ocx,用前请regsvr32   regtool.ocx 

set wshshell = CreateObject("WScript.Shell") 
set registry = CreateObject("regtool.tob") 
'获取一个dictionary对象存储键名 
set dict = CreateObject("Scripting.Dictionary") 
'列举HKEY_CLASSES_ROOT中所有键 
set allkeys = registry.RegEnum("HKCR\") 
'排除所有键中键名有点的。 
for each key in allkeys 
'第1个点在哪儿(跳过初始点)? 
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  </div>

您可能想查找下面的文章:

  • VBS获取文件MD5值(无组件)
  • 用vbs列出机器上所有能调用的组件

相关文章

  • VBS基础编程教程 (第1篇)
  • VBS脚本也有GUI图形界面 日志清除功能
  • 用vbs读取远程计算机上的文本文件的代码
  • 用vbs控制iis创建虚拟目录的代码
  • 用vbs将名称截断以使其最多包含 16 个字符的代码
  • 可以修改脚本自身运行次数的vbs(Self modifying script)
  • Wscript 和 Cscript 运行脚本的区别详解
  • vbs实现恢复暂停的自动启动服务的脚本
  • 雷客图ASP站长安全助手vbs测试版代码
  • 使用ADSI、ASP和一对魔术戏法自动地创立一个虚拟目录的方法

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • vbscript 调用WebService实现代码
    • 防止网页脚本病毒执行的方法-from web
    • 用vbs实现的简单的服务器文件备份办法压缩文件名自动按日期命名
    • MSScriptControl.ScriptControl组件属性、方法、事件介绍
    • VBS教程:函数-InStr 函数
    • vbscript 读取xml格式的配置文件
    • VBS教程:运算符-赋值运算符 (=)
    • 获取远程机器共享目录的物理路径的代码
    • 用vbs计算某个词在日志文件中的出现次数
    • ipclear.vbs源代码

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有