Search-RegistryKey

This command searches below the specified registry key for the key in which the specified value is set.


Settings:

  • Start searching from this registry key
    Enter the registry key from which the specified value is searched.
  • Name
    Optionally the default value of the key or the name of another value.
    • Default value
      Click this radio button to search for the default value in the registry.
    • Radio button
      Select an existing value (on the packaging system) from the drop-down list or enter the value name manually.
  • Value
    Search for a specific value content. This is useful if there are several values.
  • Parent index
    Zero-based index in reverse order. As many key registry levels are truncated on the right as are specified as index numbers.

    Example: If 1 is specified as the parent index, one level above the finding key level is returned, so in the example below, the result variable contains F3. If 0 were specified, the result would be F4.
  • Variable name
    The result variable to be set. Specify only the name of the variable, not the $ sign and curly brackets.
  • Value type
    String or DWORD.
  • Save full path in the variable
    If checked, the full path is stored in the variable. The result in the example below would be HKEY_CURRENT_USER\Software\Search-RegistryKey\F1\F2\F3.
  • Use 32-Bit mode on x64 computer
    If the script runs on a 64-bit operating system, referencing the HKEY_LOCAL_MACHINE\SOFTWARE key allows the 32-bit application counterpart HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node to be used automatically.


Example:

The following example searches below HKEY_CURRENT_USER\Software\Search-RegistryKey for a DWord value named test, which has a value of 5 and returns in the result variable _Result the full path to a key level above the found location.



Corresponds to DSM eScript command:

  • RegSearchFolder


See also: