This is from the manual RegRead (and work)
Code: Select all
RegRead, OutputVar, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion, ProgramFilesDir
MsgBox, Program files are in: %OutputVar%
Code: Select all
; vKey := "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Elevate\StoppCommLog-UAC"
; RegRead vExist, %vKey%, Id
RegRead, vExist, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Elevate\StoppCommLog-UAC, Id
If ErrorLevel ; Should error if no key exists.
{ MsgBox 16, Rad %A_LineNumber% -> %A_ScriptName%,
( LTrim
KEY is missing!`n
ErrorLevel .: %ErrorLevel% `n
%vKey%
)
}
MsgBox % "Result .: " vExist