Skip to content

Registry

lainz edited this page Jul 22, 2016 · 2 revisions

#Registry In each function when asked for MainKey you must use:

  • 0: HKEY_CLASSES_ROOT
  • 1: HKEY_CURRENT_CONFIG
  • 2: HKEY_CURRENT_USER
  • 3: HKEY_LOCAL_MACHINE
  • 4: HKEY_USERS

#Registry.CreateKey Creates a key in the Registry.

Parameters: MainKey, SubKey

Registry.CreateKey(2, "Software\\My Application")

#Registry.DeleteKey Deletes a key in the Registry.

Parameters: MainKey, SubKey

Registry.DeleteKey(2, "Software\\My Application")

#Registry.DeleteValue Deletes a value from the Registry.

Parameters: MainKey, SubKey, Value

Registry.DeleteValue(2, "Software\\My Application", "Name")

#Registry.DoesKeyExist Determines if a key exists and returns true or false.

Parameters: MainKey, SubKey

result_boolean = Registry.DoesKeyExist(2, "Software\\My Application")

#Registry.GetAccess Checks if a Registry key has specific access rights and returns true or false.

Parameters: MainKey, SubKey, Rights

result_boolean = Registry.GetAccess(2, "Software\\My Application", 131097)

Rights can be:

  • 131097: ACCES_READ
  • 131078: ACCESS_WRITE
  • 8: ACCESS_ENUMERATE
  • 98103: ACCESS_ALL

#Registry.GetKeyNames Returns a table containing the names of all of the sub keys for a particular key.

Parameters: MainKey, SubKey

result_table = Registry.GetKeyNames(2, "Software\\My Application")

#Registry.GetValue Returns a specific Registry value data.

Parameters: MainKey, SubKey, Value

result_string = Registry.GetValue(2, "Software\\My Application", "Name")

#Registry.GetValueNames Returns all the names of all the values in a specific sub key.

Parameters: MainKey, SubKey

result_table = Registry.GetValueNames(2, "Software\\My Application")

#Registry.GetValueType Returns a Registry value type.

Parameters: MainKey, SubKey, Value

result_number = Registry.GetValueType(2, "Software\\My Application", "Name")

The result number can be:

  • 0: none
  • 1: string
  • 2: expand string
  • 3: binary data
  • 4: 32-bit number

#Registry.SetValue Sets the data of a specific Registry value.

Parameters: MainKey, SubKey, Value, Data, Type

Registry.SetValue(2, "Software\\My Application", "Name", "Test App", 1)

Type can be:

  • 1: string
  • 2: expand string
  • 3: binary data
  • 4: 32-bit number
Clone this wiki locally