locked
Deleting directories that won't delete RRS feed

  • Question

  • When deleting large directories some subdirectories have files and folders that have failed to inherit domain administrator ownership. When attempting to delete the directories you simply get a message saying "you need permission to perform this action". Taking ownership with powershell

    #takeown /F thefoldername /R /D Y

    reports as successful but attempting to delete again just gives the same message. In the past I've just have to tunnel down into every folder to find that one file has not picked up ownership and do it manually. There must be an easier way? I come across this a lot. 

    Thanks

    Thursday, February 7, 2013 5:49 PM

Answers

  • Not sure if this will solve the issue or not, but the technet takeown page contains the following comment:

    After deleting the lock with takeown, you might have to use Windows Explorer or the cacls command to give yourself full permissions to the files and directories before you can delete them. For more information about cacls, see "Additional references" at the end of this topic.

    • Proposed as answer by 朱鸿文 Friday, February 8, 2013 4:06 AM
    • Marked as answer by 朱鸿文 Monday, February 11, 2013 2:24 AM
    Thursday, February 7, 2013 6:40 PM

All replies

  • Not sure if this will solve the issue or not, but the technet takeown page contains the following comment:

    After deleting the lock with takeown, you might have to use Windows Explorer or the cacls command to give yourself full permissions to the files and directories before you can delete them. For more information about cacls, see "Additional references" at the end of this topic.

    • Proposed as answer by 朱鸿文 Friday, February 8, 2013 4:06 AM
    • Marked as answer by 朱鸿文 Monday, February 11, 2013 2:24 AM
    Thursday, February 7, 2013 6:40 PM
  • Thanks that did it.

    Tuesday, February 12, 2013 11:24 AM