Fix Error 0x80070091 When Deleting Files in Windows 10

So I was messing around with some Android files in my Windows 10 computer and was using Cygwin to run some commands. Later on when I wanted to delete some folders, Windows refused to delete them giving “Error 0x80070091: The directory is not empty”. I checked the user ownership to the folder and I had all the permissions, but still it refused to delete the folder. Finally, I figured out the reason behind this deadlock – the chmod command from Cygwin had changed the folder permissions. So the only solution is to revert the permissions back using the same chmod command.

Fix Error 80070091 When Deleting Folders in Windows

Here are a few things you can do to fix the error 0x80070091 in Windows 10:

1. Check the disk for errors

  1. Open the File Explorer, right-click on the disk on which you are experiencing this error when deleting the files and select Properties.
  2. In the disk properties window, select the Tools tab and then click on Check button under the Error checking section.Fix Error 80070091 When Deleting Folders in Windows
  3. Start the disk checking by clicking on the Scan drive and let it finish. It may need to reboot your PC to finish the disk check.
  4. When the disk check has finished try deleting the folder/file in question again.

2. Change Ownership of the Folder/Files

  1. Press the Win+X hotkey and select Command Prompt (Admin) from the menu that appears.>
  2. Type the command Takeown /F FOLDERPATH /R /D Y in the command prompt where FOLDERPATH is the full path and name of the folder you want to change the ownership of. For example, if you want to change the ownership of E:\boot\rmdisk then type the following command:
    takeown /F E:\boot\rmdisk /R /D Y

    Fix Error 80070091 When Deleting Folders in Windows

  3. Now try deleting the file or folder that was giving an error once again.

3. Use Cygwin to Change Folder/File Permissions

  1. Install Cygwin on your Windows PC. You can see instructions on https://www.cygwin.com/.
  2. Use the Cygwin Terminal and give the command chmod a=rwx folderpath where the folderpath is the full path and name of the folder you want to change the permissions of. For example, if you want to change permissions of E:\boot\rmdisk then type the following commands one per line:
    cd e:/
    chmod a=rwx ./boot/rmdisk

    Fix Error 80070091 When Deleting Folders in Windows

  3. Now try deleting the folder giving error once again.

Summary: There are many reasons for the error 0x80080091 in Windows. You can fix it by checking the file system for errors, taking the ownership for the folders or files in question or changing their access permissions using the Cygwin chmod command.

3 comments

  1. it’s really helpful by checking the disk I had easily deleted that folder…thanks buddy…!!!

Comments are closed.