Jump to content

Registery Subkey found problem


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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.

Link to comment
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.

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
Link to comment
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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...