In the Windows registry, adding the LegacyDisable
string value to a key serves the purpose of instructing Windows to disregard the key, its values and any of its subkeys and subvalues, effectively disabling it.
For example, adding the LegacyDisable
string value to the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\opennewwindow
…disables opennewwindow
, removing the "Open in New Window" item from Windows Explorer's context menu. CCleaner's context menu cleanup tools also make use of LegacyDisable
for this purpose.
However, documentation on the string value seems non-existent; I've not been able to find anything at all documenting it, either on here or via Google, so I'm left confused about where it came from, whether disabling registry keys is all it was ever intended for, and why it's not documented.
Is disabling registry keys LegacyDisable
's only purpose?
When used to disable registry keys, how does its behaviour differ from the other method employed by CCleaner – prepending plain text to a string value's hex data? Why does CCleaner employ both methods?
Best Answer
I did some sleuthing work on LegacyDisable that I detail below.
This method is documented by Microsoft in the article Verbs and File Associations - Registering Verbs for Backward Compatibility:
The use of LegacyDisable seems limited for disabling shell-context verbs, as it is always only described in this context.
This method is used by the utility ShellMenuView where it says "this Registry key is not supported by Windows 98", so it seems that it originated in Windows NT.
I have found this method referenced in two books :
I think that is about all the useful information that can be found for LegacyDisable.
As to why CCleaner employs this method together with the other method of destroying the key, I can only make two conjectures: