Need wisescript to find the subkey in a registry
Hi All,
I need to find the subkey in a registry, to be clear i'll explain in detail
HKLM\SOFTWARE\ABC\XYZ\PQR\{aaaaa-djddjkd-ddddada-ddsadad}
where the highlighted is the GUID generated for each install.
In the GUID i have the uninstallstring, so is it possible to can i retrieve the uninstallstring and then can i use it to execute with execute program.
Your help will sincerely appreciated.
I need to find the subkey in a registry, to be clear i'll explain in detail
HKLM\SOFTWARE\ABC\XYZ\PQR\
In the GUID i have the uninstallstring, so is it possible to can i retrieve the uninstallstring and then can i use it to execute with execute program.
Your help will sincerely appreciated.
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
Bula
13 years ago
Hi,
I think wise cannot do this.
This vbs will find key that you looking for. You can easly modify, for example run section etc.
On error resume next
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set ws = CreateObject("WScript.Shell")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
var1 = "7-Zip 9.13 (x64 edition)"
For Each subkey In arrSubKeys
tmp = Ws.RegRead("HKEY_LOCAL_MACHINE\" & strKeyPath & "\" & subkey & "\DisplayName" )
tmp2 = StrComp(tmp,var1)
if tmp2 = 0 then
msgbox tmp,,""
end if
Next
I think wise cannot do this.
This vbs will find key that you looking for. You can easly modify, for example run section etc.
On error resume next
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set ws = CreateObject("WScript.Shell")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
var1 = "7-Zip 9.13 (x64 edition)"
For Each subkey In arrSubKeys
tmp = Ws.RegRead("HKEY_LOCAL_MACHINE\" & strKeyPath & "\" & subkey & "\DisplayName" )
tmp2 = StrComp(tmp,var1)
if tmp2 = 0 then
msgbox tmp,,""
end if
Next
Posted by:
anonymous_9363
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.