Registry.GetValue

string Registry.GetValue ( 

number  MainKey,

string  SubKey,

string  Value,

boolean AutoExpand = true )

Example 1

reg_data = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\My Application", "InstallPath", false);

Gets the data in the "InstallPath" value found in "HKEY_LOCAL_MACHINE\Software\My Application" and stores it in a variable called "reg_data."

Example 2

-- Set the data "Saved Value" in the user's Registry.
Registry.SetValue(HKEY_CURRENT_USER, "Software\\My Application", "MyValue", "Saved Value", REG_SZ);

-- Read the previously written value.
registry_value = Registry.GetValue(HKEY_CURRENT_USER, "Software\\My Application", "MyValue", true);

-- Display the value read from the Registry in a dialog.
Dialog.Message("Registry Data", "The value read from the Registry is "..registry_value..".");

Sets the "MyValue" value's data to the string "Saved Value". The value is located in "HKEY_CURRENT_USER\Software\My Application" and will have a value of REG_SZ. That value is then read back and displayed in a dialog.

Note: _ProgramFilesFolder is a built-in variable that contains the path to the user's Program Files folder.

See also:  Related Actions