中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-06 09:21
48,039 主题排行 / 350,124 发帖 / 今日 0 篇 / 48,251 会员排行
DOS批处理 & 脚本技术(批处理室) » 请问这段注册表如何用VBS的RegWrite写出来
可打印版本  1,349 / 4
第1楼 hello547rf44 发表于 2007-11-06 15:49
初级用户 发帖 63 积分 172
请问这段注册表如何用VBS的RegWrite写出来
请问这段注册表如何用VBS的RegWrite写出来

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Display Inline Videos"="yes"
"Play_Background_Sounds"="yes"
"Play_Animations"="yes"
第2楼 abcd 发表于 2007-11-06 16:08
银牌会员 发帖 739 积分 1,436
什么意思啊?

是写入注册表,还是从注册表读取啊
第3楼 lgaint 发表于 2007-11-06 17:47
初级用户 发帖 7 积分 22
object.RegWrite(strName, anyValue [,strType])
参数
object
WshShell 对象。
strName
表示要创建、添加或更改的项名、值名或值的字符串值。
anyValue
要创建的新项名称、要添加到现有项中的值名或要指派给现有值名的新值。
strType
可选。表示值的数据类型的字符串值。

############################################
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Display Inline Videos"="yes"
"Play_Background_Sounds"="yes"
"Play_Animations"="yes"
############################################

set wshshell=wscript.createobject("WScript.Shell")

wshshell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Display Inline Videos", "yes"
wshshell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Play_Background_Sounds", "yes"
wshshell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Play_Animations", "yes"

set wshshell=nothing

另存为VBS文件即可
第4楼 hello547rf44 发表于 2007-11-06 19:23
初级用户 发帖 63 积分 172
太谢谢了!!!
第5楼 hello547rf44 发表于 2007-11-06 20:16
初级用户 发帖 63 积分 172
把上面那段注册表的VBS单独保存可以运行。把它加在下面那段VBS上面为什么会报错呢?



set wshshell=wscript.createobject("WScript.Shell")

wshshell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Display Inline Videos", "yes"
wshshell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Play_Background_Sounds", "yes"
wshshell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Play_Animations", "yes"
set wshshell=nothing





set WshShell = Wscript.CreateObject("Wscript.Shell")
path = WshShell.CurrentDirectory
set ie=wscript.createobject("internetexplorer.application","event_")
ie.fullscreen=1
ie.width=300
ie.height=100
ie.navigate path & "\" & wscript.arguments(0)
ie.left=fix((ie.document.parentwindow.screen.availwidth-ie.width)/2)
ie.top=fix((ie.document.parentwindow.screen.availheight-ie.height)/2)
ie.visible=1
wscript.sleep 3000
ie.quit
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023