Jump to content

Recommended Posts

Posted

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
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
Posted

$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.

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
Posted

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

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
×
×
  • Create New...