cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
deepak407
Level 5

Registry Key Value

how to find the key value from registry through scripting:

Example:

HKEY_CURRENT_USER\Software\7-Zip\Path

"InstallDir" is a key name & i need to read this value
Labels (1)
0 Kudos
1 Reply
HenryL
Level 5

A simple vbs example:

Function Get7zDir()
On Error Resume Next
Dim objReg
Set objReg = CreateObject("WScript.Shell")
Get7zDir = objReg.RegRead ("HKCU\Software\7-Zip\Path\InstallDir")
End Function

However, are you sure you're looking for the right key/entry? "Path" is an entry and has value like "C:\Program Files\7-Zip". So I would use
Get7zDir = objReg.RegRead ("HKCU\Software\7-Zip\Path")

BTW: you can also use the AppSearch and RegLocator tables to read value from registry.
0 Kudos