Sign in to follow this  
Followers 0
radyofon

Registery Subkey found problem

9 posts in this topic

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



RegRead doesn't return a True / False result. You need to reread the help file.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

$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

#5 ·  Posted (edited)

$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

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

#7 ·  Posted (edited)

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

This code works on my machine.

What OS are you running? What version of Autoit? What steps have you followed to verify that the key actually exists on your machine?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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  
Followers 0