J. Scott Elblein
J. Scott Elblein

Reputation: 4253

AutoIt: Anyone know what's wrong with this RegRead call?

Trying to get the value of this registry key using AutoIt and it keeps failing.

My guess is it's due to the , and/or . in the key name, but I haven't been able to find any good info on this type of issue in the AutoIt docs or other Google searches. I've tried escaping each one individually and together using the usual escape character \, also with no luck.

I've confirmed the key names are correct, and also have tried a completely different reg key without the odd characters in my script just to see if it worked normally, which succeeded.

Dim $VMWare_Path = RegRead("HKLM\SOFTWARE\VMware, Inc.\VMware Workstation", "InstallPath")

Upvotes: 0

Views: 3185

Answers (1)

J. Scott Elblein
J. Scott Elblein

Reputation: 4253

Update: Well, the solution turned out to be that I needed to read from a different registry node depending of the OS version. Final code:

Local $VMWPath

if @CPUArch = "X64" Then
   ;x64 Key
   $VMWPath = RegRead("HKLM\SOFTWARE\Wow6432node\VMware, Inc.\VMware Workstation", "InstallPath")
Else
  ;x86 Key
  $VMWPath = RegRead("HKLM\SOFTWARE\VMware, Inc.\VMware Workstation", "InstallPath")
EndIf

Upvotes: 1

Related Questions