|
|
| |

How do I delete an entire key from the registry via Transact-SQL?
Answer:
You can use the xp_regdeletekey undocumented extended stored procedure
to delete an entire key from the registry via Transact-SQL.
This is the syntax of the xp_regdeletekey:
EXECUTE xp_regdeletekey [@rootkey=]'rootkey',
[@key=]'key'
|
For example, to delete the key 'SOFTWARE\Test' from 'HKEY_LOCAL_MACHINE', run:
EXEC master..xp_regdeletekey
@rootkey='HKEY_LOCAL_MACHINE',
@key='SOFTWARE\Test'
|
See this FAQ question:
How do I read from the registry via Transact-SQL?
See this article to get more useful undocumented extended stored procedures:
Useful undocumented extended stored procedures
|
|
|