There are a few ways to delete HKEY. The easiest way is to use the Windows PowerShell cmdlet, which is available in the Windows PowerShell Gallery. To delete the key “ComputerName” in the “Homes” key of the “ComputerName” object, use this command: Windows PowerShell -keyname ComputerName -delete To delete the key “UserName” in the “UserName” object, use this command: Windows PowerShell -keyname UserName -delete