SAP Help Home SAP Intelligent RPA Help Portal SAP Intelligent RPA Community

Module - Registry

Collection of functions related to Windows Registry. Use with caution: some registry information might require administrative rights.

Activities

Delete Registry Key

Delete a key or a key value from the Windows Registry. May require administrative or write rights for some nodes.


Technical Name Type Minimal Agent Version
del synchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
key string mandatory Name of the registry key or key value to be deleted.
root irpa_core.enums.registry.root optional Selects the registry root key if it is not mentioned in the key name. Default is 'Current User'

Sample Code:

irpa_core.registry.del('HKCU\\Software\\ACME\\FortuneTeller\\MindReader');

Sample Code:

irpa_core.registry.del('HKCU\\Software\\ACME\\FortuneTeller\\');

Sample Code:

irpa_core.registry.del('Software\\ACME\\FortuneTeller\\MindReader', irpa_core.enums.registry.root.CurrentUser);

Sample Code:

irpa_core.registry.del('Software\\ACME\\FortuneTeller\\', irpa_core.enums.registry.root.CurrentUser);

Note:

Specify a key-name by ending 'key' with a final backslash.

Note:

Do not include a final backslash to specify a value name.



Get Registry Information

Return a key or a key value from the Windows Registry. May require administrative or write rights for some nodes.


Technical Name Type Minimal Agent Version
get synchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
key string mandatory Name of the key or key value for which the value is to be obtained.
root irpa_core.enums.registry.root optional Selects the registry root key if it is not mentioned in the key name. Default is 'Current User'

Output Parameters:

Name Type Description
returnedKey any Returns the key or key value from the registry.

Sample Code:

data.IEVersion = irpa_core.registry.get('HKLM\\SOFTWARE\\Microsoft\\Internet Explorer\\Version'); data.IEVersion = irpa_core.registry.get('SOFTWARE\\Microsoft\\Internet Explorer\\Version', irpa_core.enums.registry.root.LocalMachine);

Note:

Specify a key-name by ending 'key' with a final backslash.

Note:

Do not include a final backslash to specify a value name.

Note:

When you specify a key-name (as opposed to a value-name), the method returns the default value.



Set Key/Key Value

Write a key or key value to the Windows Registry: create a new key, add another value-name to an existing key (and assigns it a value), or change the value of an existing value-name. May require administrative or write rights for some nodes. Please note that you need to specify a key-name by ending 'key' with a final backslash. Do not include a final backslash to specify a value name.


Technical Name Type Minimal Agent Version
set synchronous WIN-2.0.0 (WIN for Windows)

Input Parameters:

Name Type Attributes Default Description
key string mandatory Registry key to be set.
value any mandatory Value to be set.
root irpa_core.enums.registry.root optional Selects the registry root key if it is not mentioned in the key name. Default is 'Current User'
type irpa_core.enums.registry.type optional Selects the value type. Default is 'string'.

Sample Code:

irpa_core.registry.set('HKCU\\Software\\MySoftware\\MyCompany\\Settings\\Color', 'blue', irpa_core.enums.registry.root.CurrentUser, irpa_core.enums.registry.type.String);

Note:

Specify a key-name by ending 'key' with a final backslash.

Note:

Do not include a final backslash to specify a value name.