UltimateInvader Posted July 22, 2024 Posted July 22, 2024 I'm having trouble reading a registry key, it's HKLM...\Run. It works perfectly in Python and with other keys as well, but that key doesn't return any values, even though it has values. I'm running the code as an administrator: $clave = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" $archivo = "notas.txt" $fhandle = FileOpen($archivo, 2) $indice = 1 While 1 $nombreValor = RegEnumVal($clave, $indice) If @error <> 0 Then ExitLoop $valor = RegRead($clave, $nombreValor) FileWrite($fhandle, $nombreValor & ": " & $valor & "\n") $indice = $indice + 1 WEnd FileClose($fhandle) MsgBox(0, "", "Las claves HKLM\...\Run han sido escritas en: " & $archivo) I don't know why but those values from that key are not being read. Any ideas? Thanks in advance.
UltimateInvader Posted July 22, 2024 Author Posted July 22, 2024 Hi all. I'm having trouble reading a registry key, it's HKLM\...\Run. It works perfectly in Python and with other keys as well, but that key doesn't return any values in Autoit, even though it has values. I'm running the code as an administrator: $clave = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" $archivo = "notas.txt" $fhandle = FileOpen($archivo, 2) $indice = 1 While 1 $nombreValor = RegEnumVal($clave, $indice) If @error <> 0 Then ExitLoop $valor = RegRead($clave, $nombreValor) FileWrite($fhandle, $nombreValor & ": " & $valor & "\n") $indice = $indice + 1 WEnd FileClose($fhandle) MsgBox(0, "Confirmación", "Las claves HKLM\...\Run han sido escritas en: " & $archivo) I don't know why but those values from that key are not being read. Any ideas? Thanks in advance.
Developers Solution Jos Posted July 22, 2024 Developers Solution Posted July 22, 2024 (edited) You are reading the "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" when using the x86 version of AutoIt3! You can use this when reading the x64 hive in a x86 script: $clave = "HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" ...and 1 thread with this question is enough! Merged. Edited July 22, 2024 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
UltimateInvader Posted July 22, 2024 Author Posted July 22, 2024 5 minutes ago, Jos said: You are reading the "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" when using the x86 version of AutoIt3! ...and 1 thread with this question is enough! Merged. I'm sorry about repeated post, it was not my intention. Yeah, the problem was solved because I used the x64 version, a terrible mistake Thank you so much, Jos.
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