VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Rename, copy, delete entire registry keys

by Luis Cantero (14 Submissions)
Category: Registry
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

This is a registry API module that contains the usual functions to create, set, delete and count registry keys and values. Since the API does not provide a way to rename registry keys, the only way to do it is to copy the entire key including all subkeys and values which could be of different types, then delete the old key recursively (which is also not supported by the API). These functions are also included in this module, the rename/copy function supports all existing value types (REG_SZ, REG_EXPAND_SZ, REG_BINARY, REG_DWORD, REG_MULTI_SZ). The delete function has a security feature (minimum depth) to avoid accidental recursive deletion of important keys, such as HKLM\Software, etc. Make sure you read the comments I left to understand how this function works. The only other approach to renaming a registry key (which also works by copying, etc.) involves using a function to write all keys to a temp file and then save them under the new name. There is code available on the internet that demostrate this approach, but you will always need a temp file, which is not good. This makes my code, at least as of today and as far as I know, one of a kind. I hope you find it useful.

Rate Rename, copy, delete entire registry keys

Download Rename, copy, delete entire registry keys

Download Rename, copy, delete entire registry keys (4 KB)

Rename, copy, delete entire registry keys Comments

No comments have been posted about Rename, copy, delete entire registry keys. Why not be the first to post a comment about Rename, copy, delete entire registry keys.

Post your comment

Subject:
Message:
0/1000 characters