中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-09-26 20:49
共 47,813 主题排行 / 349,918 发帖 / 今日 0 篇 / 48,276 会员排行
DOS批处理 & 脚本技术(批处理室) » 注册表中二进制读取问题(VBS)
可打印版本  920 / 4
第1楼 snowhill 发表于 2008-03-15 16:00
新手上路 发帖 6 积分 11
注册表中二进制读取问题(VBS)
'Date 2008-3-15 BY:snowhill
dim wshshell,result,enable,disable,warnning,answer
enable="Now,the usb is avaliable!"
disable="Now,the sub is disable!"
warning="Warning!"
key="HKLM\system\currentcontrolset\services\usbstor\Start"
set wshshell=wscript.createObject("wscript.shell")
result= wshshell.RegRead(key)
if( result=4) then
answer=msgbox (disable&"are you want to enable the usb device?",1,Warnning)
if (answer=1) then
wshshell.Regwrite key,3,"REG_DWORD"
end if
end if
if result="3" then
answer=msgbox(enable&"are you want to disable the usb device?",1,warnning)
if(answer=1)then
wshshell.Regwrite key,4,"REG_DWORD"
end if
end if
当读DWORD值是肯定没问题地,但读BINARY值就不行,哪位高手知道如何处理REG_BINARY问题啊.msgbox alltrim(str(result(1)))这是微软官网上的一个处理办法但行不通
第2楼 abcd 发表于 2008-03-15 16:12
银牌会员 发帖 739 积分 1,436
vbs中,读取REG_BINARY的返回值是以数组形式的
第3楼 snowhill 发表于 2008-03-21 14:09
新手上路 发帖 6 积分 11
REG_BINARy返回值是以数组形式的,我怎么处理里面的值呢?能不能给一个实例.怎么改写里面的数据.
第4楼 abcd 发表于 2008-03-21 14:43
银牌会员 发帖 739 积分 1,436
set ws=createobject("wscript.shell")
arr=ws.regread("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Security\Security")
for each ar in arr
msgbox ar
next
第5楼 snowhill 发表于 2008-03-21 20:34
新手上路 发帖 6 积分 11
谢了,ABCD
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023