Error Message: "Cannot delete …. Error while deleting key."


Document relates to: All Laplink Software


SUMMARY

When attempting to modify or delete registry keys as noted in some of our articles, you may receive an error message.
"Cannot delete ... Error while deleting key."


CAUSE

When dealing with a Windows NT bases computer (NT, 2000, XP, 2003, etc), this is normally caused by the currently logged in user not having permissions to modify or delete the key. Some keys will not allow any user to modify or delete them.


SOLUTION

Make sure that the logged in user has admin permissions on the machine. 


If this is already the case, then follow these steps in order to set the permissions for the key to allow it to be deleted.


NOTE: The KEY is only visible in the left hand window of the standard Registry Editor (REGEDIT). It will be the one that has it’s folder icon open instead of closed. You can also find the path to the Key in the status bar at the bottom of the Registry Editor. If the status bar is not present, click on View -> Status Bar to enable it.

Windows 2000
Windows XP / 2003 / Vista / 7

Windows 2000

  1. Check the Status Bar to find the path to the key you are getting the error from.

  2. Click on Start.

  3. Click on Run.

  4. Type REGEDT32 into the Run line (NOTE: There is no I in this one).

  5. Click Ok.

  6. You will need to position the two windows so that you can see the status bar of the original Registry editor.
  7. - The REGEDT32 (Also called Registry Editor) will have a window open for each of the HKEY entries on that computer.

  8. Click the Title Bar (blue bar at the top) for the HKEY section that the key is in.

  9. Double-click on the folders in order to “browse” to the location of the key in question - EX: “My Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_067b&Pid_2501”.

  10. Click on the Security menu entry at the top of the REGEDT32 window and choosePermissions.

  11. On the permissions screen, verify that Everyone is present upper portion of the window. If it is, go to step 11.
  12. a) If Everyone is not present, click on Add.
    b) Type Everyone into the lower section of this screen.
    c) Click the Check Names button.
    d) Once Everyone is underlined, click Ok.

  13. Click on the Everyone entry so that it is highlighted.

  14. In the lower window, place a check into the Full Control row under the Allow column.

  15. Remove any checkmarks in the Deny column.

  16. Click Ok.

  17. Proceed with deleting the key, value or data as noted in the original article.

Windows XP / 2003 / Vista / 7

  1. In the Registry editor, right-click on the KEY and choose Permissions.

  2. On the permissions screen, verify that Everyone is present in the “Group or user names” list. If it is, go to step 3.
  3. a) If Everyone is not present, click on Add.
    b) Type Everyone into the “Enter the object names to select” box.
    c) Click the Check Names button.
    d) Once Everyone is underlined, click Ok.

  4. Click on the Everyone entry so that it is highlighted.

  5. In the lower window, place a check into the Full Control row under the Allow column.

  6. Remove any checkmarks in the Deny column.

  7. Click Ok.

  8. Proceed with deleting the key, value or data as noted in the original article.

This Article can be found by searching for:

Keywords: How To: Windows

Platforms: Win2K, WinXP, Win2k3, WinVista, Win7

Article#: 1055


You can view this article online at:
http://kb.laplink.com/index.php/article/1055