Jump to content
Sign in to follow this  
radyofon

Registery Subkey found problem

Recommended Posts

radyofon

Although Key says no. What is the problem. Help me please. I want to do or not have subkey. But it does not. Message say "no key". However there.I think the problem { }

$key = "{4A03706F-666A-4037-7777-5F2748764D10}"
If @OSArch = "X64" Then
    $uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
    Else
    $uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
EndIf

$var = RegRead($uninstall_path, $key)
If $var = True Then
    MsgBox(0, "", "key found")
        Else
    MsgBox(0, "", "no key")
EndIf

Share this post


Link to post
Share on other sites
radyofon

It doesn't work again. 

$key = "{4A03706F-666A-4037-7777-5F2748764D10}"
If @OSArch = "X64" Then
    $uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
    Else
    $uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
EndIf

If $var = RegRead($uninstall_path, $key) = "" Then
    MsgBox(0, "", "no key")
        Else
    MsgBox(0, "", "key found")
EndIf
Edited by radyofon

Share this post


Link to post
Share on other sites
Danp2

$key = "{4A03706F-666A-4037-7777-5F2748764D10}"
If @OSArch = "X64" Then
    $uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
    Else
    $uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
EndIf

$var = RegRead($uninstall_path, $key) 

If $var = "" Then
    MsgBox(0, "", "no key")
Else
    MsgBox(0, "", "key found")
EndIf

You could also check the value of @error.

Share this post


Link to post
Share on other sites
radyofon
$key = "{4A03706F-666A-4037-7777-5F2748764D10}"
If @OSArch = "X64" Then
    $uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
    Else
    $uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
EndIf

$var = RegRead($uninstall_path, $key) 

If $var = "" Then
    MsgBox(0, "", "no key")
Else
    MsgBox(0, "", "key found")
EndIf

You could also check the value of @error.

It doesn't work. What is the problem. I don't know. I think { } symbol. {4A03706F-666A-4037-7777-5F2748764D10} subkey is problem. There is in the registery subkey. But script isn't found.

Edited by radyofon

Share this post


Link to post
Share on other sites
Danp2

Ok... so you actually need to append to key to the path to get the complete keyname. Try this:

$key = "{4A03706F-666A-4037-7777-5F2748764D10}"

If @OSArch = "X64" Then
$uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\"
Else
    $uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
EndIf

$var = RegRead($uninstall_path & $key, 'InstallSource')

If $var = "" Then
MsgBox(0, @error, "no key")
Else
    MsgBox(0, "", "key found")
EndIf

Share this post


Link to post
Share on other sites
radyofon

still the same. No changes.I tried this. Could you try on your pc.

Edited by radyofon

Share this post


Link to post
Share on other sites
jguinch

If @OSArch = "X64" Then

    $uninstall_path = "HKEY_LOCAL_MACHINE64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

Else

    $uninstall_path = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

EndIf

No ?

 

 

 

Edited by jguinch

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.