Jump to content

Recommended Posts

Posted

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.

Posted

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
Posted (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 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.
  :)

Posted
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 :doh: Thank you so much, Jos.

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