|
snowhill
新手上路

积分 11
发帖 6
注册 2008-2-18
状态 离线
|
『楼 主』:
注册表中二进制读取问题(VBS)
使用 LLM 解释/回答一下
'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)))这是微软官网上的一个处理办法但行不通
|
|
2008-3-15 16:00 |
|
|
abcd
银牌会员
    
积分 1436
发帖 739
注册 2007-10-11
状态 离线
|
|
2008-3-15 16:12 |
|
|
snowhill
新手上路

积分 11
发帖 6
注册 2008-2-18
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
REG_BINARy返回值是以数组形式的,我怎么处理里面的值呢?能不能给一个实例.怎么改写里面的数据.
|
|
2008-3-21 14:09 |
|
|
abcd
银牌会员
    
积分 1436
发帖 739
注册 2007-10-11
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
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
|
|
2008-3-21 14:43 |
|
|
snowhill
新手上路

积分 11
发帖 6
注册 2008-2-18
状态 离线
|
|
2008-3-21 20:34 |
|