开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜