Archive: How to get DeleteRegKey to work


How to get DeleteRegKey to work
Hi!
This question probably have been asked many times, I checked all the previous discussions but couldn't find anything useful.
I want to delete some registry keys when I uninstall my app, but its not deleting.

DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MyCompanyName\MyAppName\IsAlreadyInstalled" 


I have RequestExecutionLevel admin
SetRegView 32

How to make it work ?

1) Are you sure IsAlreadyInstalled is really a key? It sounds like the name of a regstring to me. The key would then be etc\MyCompanyName\MyAppName.
2) HKCU is unique for each user. Are you sure it exists in the admin's HKCU hive, and not the user's?


App paths under HKCU is Win7+, older versions only use HKLM.

The correct path is "...\CurrentVersion\App Paths\myprogram.exe"

IsAlreadyInstalled is not a valid value name, the documented values are listed here...