.RegDelete - VBScript


The .RegDelete command removes a specified key from the Windows registry. It offers a convenient way to delete unwanted or unused registry entries, ensuring a clean and organized registry database.


.RegDelete keyPath

Required Arguments:

  • keyPath: The full path of the registry key to be deleted.




Simple Example:

.RegDelete "HKEY_CURRENT_USER\Software\ExampleApp"

Deleting a Specific Key Within a Subkey:

.RegDelete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ExampleService\Parameters\Config"

Common Issues

Error Checking: Always check the return value of the .RegDelete command to ensure successful execution.

Registry Permissions: Verify that you have sufficient permissions to delete the specified registry key.

Invalid Key Path: Ensure that the provided key path is valid and points to an existing registry key.


Combining with VB Script Functions:

  • Use the .FindKey function to search for registry keys before deleting them.
  • Employ the .RegWrite function to create new registry keys, complementing the deletion process.
  • .RegAdd: Adds a new registry key or value.
  • .RegRead: Reads a value from the registry.
  • .RegEnum: Enumerates keys and values within a registry key.