Skip to content
⌘ NSIS Forum Archive

Remove regitry key from HKEY_CURRENT_USER for ALL users

6 posts

Oleg767#edited

Remove regitry key from HKEY_CURRENT_USER for ALL users

Hello.

Here's the question:
How can I remove some specific registry key located in HKEY_CURRENT_USER from ALL user accounts on this machine?
(This key is created by application in run time and contains some user-specific settings for each user).

Any help or hint are greatly appretiated.
viper0179#
You're not able to remove keys while under different user accounts. If you're wanting to store global registry keys use the HKEY_LOCAL_MACHINE (HKLM) key for your values instead of HKEY_CURRENT_USER (HKCU). Since you're using the HKCU key to store the different user settings, you may want to place them in the HKLM with a subkey of the username. That would be a viable alternative.
kichik#
That won't be a good idea as not all users are able to write to HKLM. Unfortunately, I don't have a solution to the original problem. I have tried searching Google for it but all I could find is "you can't do it" 🙁
viper0179#
I guess the only alternative would be to create an INI file and store the information in there.
0mar#
I'm not sure that this will help you, but I know for a fact that it won't hurt. 😁

Please look at the script IGx89 posted in this thread. Hopefully it will help you achieve what you're after.