中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-06 10:28
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 请问这段注册表如何用VBS的RegWrite写出来 查看 1,351 回复 4
楼 主 请问这段注册表如何用VBS的RegWrite写出来 发表于 2007-11-06 15:49 ·  中国 香港 腾讯云
初级用户
★★
积分 172
发帖 63
注册 2007-11-03 10:37
18年会员
UID 101564
性别 男
状态 离线
请问这段注册表如何用VBS的RegWrite写出来

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Display Inline Videos"="yes"
"Play_Background_Sounds"="yes"
"Play_Animations"="yes"
2 发表于 2007-11-06 16:08 ·  中国 香港 腾讯云
银牌会员
★★★
积分 1,436
发帖 739
注册 2007-10-11 17:44
18年会员
UID 99469
性别 男
状态 离线
什么意思啊?

是写入注册表,还是从注册表读取啊
3 发表于 2007-11-06 17:47 ·  中国 广东 广州 白云区 电信
初级用户
积分 22
发帖 7
注册 2006-10-25 03:39
19年会员
UID 68145
性别 男
状态 离线
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文件即可
本帖最近评分记录 (共 2 条) 点击查看详情
评分人分数时间
hello547rf44 +2 2007-11-06 19:23
313885174 +2 2008-07-01 21:06
4 发表于 2007-11-06 19:23 ·  中国 香港 腾讯云
初级用户
★★
积分 172
发帖 63
注册 2007-11-03 10:37
18年会员
UID 101564
性别 男
状态 离线
太谢谢了!!!
5 发表于 2007-11-06 20:16 ·  中国 香港 腾讯云
初级用户
★★
积分 172
发帖 63
注册 2007-11-03 10:37
18年会员
UID 101564
性别 男
状态 离线
把上面那段注册表的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
论坛跳转: