getRegistryValue() / get64BitRegistryValue
Warning: Certain registry locations require 64-Bit Commands for 64-bit Windows machines.
After entering the registry path, the value contained in the key is returned. A check can be made for existence, absence, equality, or size differences. For example, HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\AppPaths\AgentMon.exe\path
contains the directory path identifying where the agent is installed on the target machine. The test determines if the value stored for this key exists, thereby verifying the agent is installed.
The available tests are:
Exists
: true if the registry key exists in the hive.Does Not Exist
: true if the registry key does not exist in the hive.=
: true if value of the registry key equals the test value.Not =
: true if value of the registry key does notequal the test value.>
: true if value of the registry key is greater than the test value (value must be a number).>=
: true if value of the registry key is greater than or equal to the test value (value must be a number).<
: true if value of the registry key is less than the test value (value must be a number).<=
: true if value of the registry key is less than or equal to the test value (value must be a number).Contains
: true if the test value is a sub string of the registry key value (value must be a string).Not Contains
: true if the test value is not a sub string of the registry key value (value must be a string).
Using the Backslash Character (\)
A backslash character \
at the end of the key returns the default value of that key. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WORDPAD.EXE\
returns a default value, such as %ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE
The last single backslash in a string is used to delimit the registry key from the registry value. To include backslashes as part of the value string, specify double slashes for each slash character. For example, the string HKEY_LOCAL_MACHINE\SOFTWARE\SomeKey\Value\\Name
is interpreted as the key HKEY_LOCAL_MACHINE\SOFTWARE\SomeKey
with a value of Value\Name
.
Example
if isUserLoggedIn(" ")
getVariable("Registry Value", "HKEY_CURRENT_USER\KaseyaAgent-HKCUTest\TestREG_DWORD", "regDWORD", "All Operating Systems, "Halt on Fail"