The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



DeleteRegKey


Unit: SDL_filesys
Class: none
Declaration: function DeleteRegKey (RootKey: HKey; SubKey: string): boolean;

The function DeleteRegKey deletes a Windows registry key with all its values and subkeys. The parameter RootKey defines the root key and can take one of the following values: HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_PERFORMANCE_DATA, HKEY_CURRENT_CONFIG and HKEY_DYN_DATA. The parameter SubKey specifies the key (including its path) used within the branch of the root key.

The function returns TRUE if the key has been deleted successfully.

Hint: Be careful, this function is potentially dangerous and might completely destroy your installation if applied to a critical key.

Example: The statement
DeleteRegKey (HKEY_CURRENT_USER, '/Software/MyProduct/Customization');
deletes the registry key HKEY_CURRENT_USER/Software/MyProduct/Customization and all ist values and subkeys.



Last Update: 2023-Feb-06