fya*_*sar 28
function readFromRegistry (strRegistryKey, strDefault )
Dim WSHShell, value
On Error Resume Next
Set WSHShell = CreateObject("WScript.Shell")
value = WSHShell.RegRead( strRegistryKey )
if err.number <> 0 then
readFromRegistry= strDefault
else
readFromRegistry=value
end if
set WSHShell = nothing
end function
Run Code Online (Sandbox Code Playgroud)
用法:
str = readfromRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\ESD\Install_Dir", "ha")
wscript.echo "returned " & str
Run Code Online (Sandbox Code Playgroud)
尝试这样的事情:
Dim windowsShell
Dim regValue
Set windowsShell = CreateObject("WScript.Shell")
regValue = windowsShell.RegRead("someRegKey")
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
107998 次 |
| 最近记录: |