In particular, I want to delete all traces of COMn ports that have been
uninstalled, so when my software calls EnumPorts, it will return a list
of only those serial ports that are currently implemented.
What I have tried:
Regedt32, run as Administrator. I can't delete, rename, or change anything
in this section. Typical error message: Cannot delete <key_name>: Error while
deleting key.
I scanned with RegDelNull, and it did not find any nulls in the strings.
I exported the relevant section as a .REG file, modified it according to
directions, and attempted to MERGE the modified file. The error message
included the sentence "Some keys are open by the system or other processes".
So maybe the system always has the Enum keys open.
Here is what MSDN has to say about HKEY_LOCAL_MACHINE:
...It contains subkeys that hold current configuration data, including Plug
and Play information (the Enum branch, which includes a complete list of
all hardware that has ever been on the system), network logon preferences,...
So is there a way to delete this stuff? I don't think I can be the only
person in the world who ever wanted to do this.