如何使用VbScript检查注册表值?
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
用法:
str = readfromRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\ESD\Install_Dir","ha") wscript.echo "returned " & str