As an administrator, you often get the above error when you try to delete a folder. Obviously, my first thought was a permissions issue, but knowing how Windows works, you can never trust the error message either. Unfortunately, when dealing with the “You don’t have permission” issue, it’s either an actual permission issue or it’s because the file or folder is locked by a process.
Even though you have corrected the permission issue or taken ownership of the said folder, still you will get errors about the permission issues or the file name length is too long etc..
Here are a few steps to delete the folder from your server.
Run the following command with elevated privilege.
If {Folder Path} has sub-folders, and/or possibly contains files, they may themselves be owned or secured in a way that continues to prevent removal of the parent folder.
Use takeown /f {Folder Path} /r as the /r adds recursive ownership modification to sub-folders and files.
Likewise, use cacls {Folder Path} /G administrators:F /t as the /t applies DACL changes recursively to sub-folders and files.
If you still can not delete files and folders after you have successfully done as per previous instructions, you will need to run cmd and use this command:
rd <folder name> /s/q
I hope you can do it.
Advertisement