开发者

how to read (Default) value in Registry Key in VBScript/JScript

开发者 https://www.devze.com 2023-01-13 15:24 出处:网络
I can read the value of the key n开发者_StackOverflow社区ame \"UpdateCheck\" under HKEY_LOCAL_MACHINE\\SOFTWARE\\CCleaner\\

I can read the value of the key n开发者_StackOverflow社区ame "UpdateCheck" under

HKEY_LOCAL_MACHINE\SOFTWARE\CCleaner\

with Shell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\CCleaner\UpdateCheck")

But I cannot read that of the key name "(Default)" .

Shell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\CCleaner\Default")

How to read it?


Just pass the key name to RegRead and you'll get the default value. E.g.:

Shell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\CCleaner\")

NOTE: Notice the trailing \ in the regkey path. If that is missed out, it will try to read string value CCleaner from HKEY_LOCAL_MACHINE\SOFTWARE. Refer below .reg file snippet for more understanding.

[HKEY_LOCAL_MACHINE\SOFTWARE]
"CCleaner"="Some string value"

[HKEY_LOCAL_MACHINE\SOFTWARE\CCleaner]
@="some-default-value"
0

精彩评论

暂无评论...
验证码 换一张
取 消