标题: 请问这段注册表如何用VBS的RegWrite写出来
[打印本页]
作者: hello547rf44
时间: 2007-11-6 15:49
标题: 请问这段注册表如何用VBS的RegWrite写出来
请问这段注册表如何用VBS的RegWrite写出来
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Display Inline Videos"="yes"
"Play_Background_Sounds"="yes"
"Play_Animations"="yes"
作者: abcd
时间: 2007-11-6 16:08
什么意思啊?
是写入注册表,还是从注册表读取啊
作者: lgaint
时间: 2007-11-6 17:47
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文件即可
作者: hello547rf44
时间: 2007-11-6 19:23
太谢谢了!!!
作者: hello547rf44
时间: 2007-11-6 20:16
把上面那段注册表的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