Board logo

标题: 如何用VBS添加注册表指定项? [打印本页]

作者: applearea    时间: 2009-11-9 10:48     标题: 如何用VBS添加注册表指定项?

导入注册表文件如下:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\SuperHidden]
@="{00000000-0000-0000-0000-000000000012}"
[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\InProcServer32]
@=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,73,\
  68,64,6f,63,76,77,2e,64,6c,6c,00
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance]
"CLSID"="{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"
[HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag]
"method"="ShellExecute"
"Param1"="C:\\Windows\\ShowHide.VBS"
"command"="显示隐藏文件"
"CLSID"="{13709620-C279-11CE-A49E-444553540000}"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"ShowSuperHidden"=dword:00000000
"Hidden"=dword:00000002
请问如何编写vbs脚本写入如上值!
我写了第一个是这样的:
Dim HiddenShowFile
Set HiddenShowFile=WScript.CreateObject("WScript.Shell")
HiddenShowFile.Write "HKCR\Directory\Background\shellex\ContextMenuHandlers\SuperHidden\", "{00000000-0000-0000-0000-000000000012}", "REG_SZ"
显示“对象不支持此属性或方法:‘Write’”
不知为何,请高人指教,不胜感激!谢谢!
作者: zqz0012005    时间: 2009-11-9 12:27

RegWrite

[手册]Windows 脚本技术
http://www.bathome.net/thread-1985-1-1.html

VBS教学&资料
http://www.bathome.net/forum-7-1.html
作者: applearea    时间: 2009-11-10 16:43

谢谢版主,都是例子惹的祸。那个例子有问题!http://hi.baidu.com/lanseyudibn/ ... 519c264e4aea7f.html
最后的一个例子错误,应该是regwrite,不是write!
作者: applearea    时间: 2009-11-10 17:00

哇!终于会修改注册表了,太J动了!感谢各位了!




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2