How can I delete a registry value/key from the command line?
John Savill
September 13, 1999
1 Min Read
A. A. Using the Windows NT Resource Kit Supplement 2 utility REG.EXE you can delete a registry value from the command line or batch file, e.g.
reg delete HKLMSoftwaretest
Would delete the HKEY_LOCAL_MACHINESoftwaretest value. When you enter the command you will be prompted if you really want to delete, enter Y. To avoid the confirmation add /force to the command, e.g.
reg delete HKLMSoftwaretest /force
A full list of the codes to be used with REG DELETE are as follows:
HKCR | HKEY_CLASSES_ROOT |
HKCU | HKEY_CURRENT_USER |
HKLM | HKEY_LOCAL_MACHINE |
HKU | HKEY_USERS |
HKCC | HKEY_CURRENT_CONFIG |
To delete a entry on a remote machine add the name of the machine, \, e.g.
reg delete HKLMSoftwaretest \johnpc
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like