charly99 Posted October 29, 2022 Share Posted October 29, 2022 I am trying to understand the function of regread() with a program taken as an example: bandicamfree. Supposedly the program is installed in "ProgramFiles" so the registry key is: "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Bandicam", "") but when I run this: $regPath = RegRead("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Bandicam", "") ;InstallLocation or UninstallString If @error Then MsgBox(48, "1", "Error :" & @error, 4) Else MsgBox(48, "2", "Error :" & @error, 4) EndIf ;or ;@error > 0 with the same result: 1 whatever you do the result is always: 1 if the program is installed in "C:\Program Files\Bandicam" in a 64bit system why can't find the registry key? or am I wrong about something? But if I do this: $regPath = RegRead("HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Bandicam", "");InstallLocation If @error Then MsgBox(48, "1", "Error :" & @error, 4) Else MsgBox(48, "2", "Error :" & @error, 4) EndIf it works 🤨 Isn't locating a registry key of an installed program in: "C:\ProgramFiles(x86)\Bandicam" supposed to be: "WOW6432Node" on a 64bit system? or am i doing something wrong? Link to comment Share on other sites More sharing options...
rudi Posted October 31, 2022 Share Posted October 31, 2022 (edited) Hello, what's the output of this script? $MyEnv="CPU = " & @CPUArch & @CRLF $MyEnv &= "OS Arc = " & @OSArch & @CRLF if @AutoItX64 Then $MyEnv &= "Autoit running X64" & @CRLF Else $MyEnv &= "Autoit running x86" & @CRLF EndIf $MyEnv &= "Autoit version = " & @AutoItVersion MsgBox(0, '', $MyEnv) Edited October 31, 2022 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
charly99 Posted October 31, 2022 Author Share Posted October 31, 2022 (edited) Edited November 2, 2022 by charly99 Link to comment Share on other sites More sharing options...
rsn Posted November 1, 2022 Share Posted November 1, 2022 I wonder if it writes the to the 32 bit subsystem because the installer is 32 bits? Link to comment Share on other sites More sharing options...
rudi Posted November 2, 2022 Share Posted November 2, 2022 22 hours ago, rsn said: I wonder if it writes the to the 32 bit subsystem because the installer is 32 bits? I assume, that this is the reason... 32bit actions are redirected to the HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ registry key. this code will return the 64bit in the SciTE output pane, followed by the 32bit part. ConsoleWrite("HKLM: ----------------------------------------------------------------" & @CRLF) $i=0 while 1 $i+=1 $KeyName=RegEnumKey("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",$i) $Err=@error if $Err Then ExitLoop ConsoleWrite("Instance " & $i & @TAB & $KeyName & @CRLF) WEnd ConsoleWrite("HKLM64: ----------------------------------------------------------------" & @CRLF) $i=0 while 1 $i+=1 $KeyName=RegEnumKey("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",$i) $Err=@error if $Err Then ExitLoop ConsoleWrite("Instance " & $i & @TAB & $KeyName & @CRLF) WEnd MsgBox(0, '', "done") and that one will write and read back some value to 32 and 64 bit: expandcollapse popup#RequireAdmin $StrResult="Result:" & @CRLf $Key="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $ValName="ThisIsThe32bitValue" $Type="REG_DWORD" $Wert=32 $result=RegWrite($Key,$ValName,$Type,$Wert) $StrResult &= "Key: " & $Key & @CRLF & _ "Value Name: " & $ValName & @CRLF & _ "Type: " & $Type & @CRLF & _ "Value Data: " & $Wert & @CRLF & _ "@Error = " & @error & @CRLF $ReadBack=RegRead($Key,$ValName) $StrResult&="ReadBack: " & $ReadBack & @CRLF & _ "@Error = " & @error & @CRLF & @CRLF $Key="HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" $ValName="ThisIsThe64bitValue" $Type="REG_DWORD" $Wert=64 $result=RegWrite($Key,$ValName,$Type,$Wert) $StrResult &= "Key: " & $Key & @CRLF & _ "Value Name: " & $ValName & @CRLF & _ "Type: " & $Type & @CRLF & _ "Value Data: " & $Wert & @CRLF & _ "@Error = " & @error & @CRLF $ReadBack=RegRead($Key,$ValName) $StrResult&="ReadBack: " & $ReadBack & @CRLF & _ "@Error = " & @error & @CRLF MsgBox(0,"Result",$StrResult) Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now