While deleting a file or folder on Windows, you may encounter the “Directory is not empty” error. It prevents you from deleting a file or folder and might appear out of the blue on your device. It doesn’t sound very pleasant! So how do I diagnose this error and fix it? Finally, you’ve arrived at the appropriate location. To resolve the directory is not empty error code 0x80070091 on Windows 11, we have given a range of remedies in this post. Let’s begin by learning about these potential fixes.
Error Code 0x80070091 The Directory Not Empty Causes
When you attempt to delete a folder that still includes files or subfolders, Windows displays the “Directory is Not Empty” error. To avoid accidentally deleting crucial data, the error message app shows. Because part of the folder’s contents are still open or being used by another process, Windows may throw you an error if it determines that the folder is already in use. For instance, a file within the folder you attempt to delete may be opened in an app or used as a shortcut elsewhere. You may also encounter this error if the folder’s contents are marked as read-only. Hence, you can only delete the folder once you remove the read-only property. To eliminate the error, try the solutions indicated below.
How To Fix Error Code 0x80070091 The Directory Is Not Empty On Windows 11?
Delete Folder Using Command Prompt
You may also use Command Prompt if you cannot delete a folder using the standard way. For example, with the “rmdir” command, you may use the Command Prompt to delete a file or folder on Windows. Here is what you must do.
1 – Select the search button on the Taskbar, type “Command Prompt,” and then select the “Run as administrator” option to open the app in administrator mode.
2 – To delete a file or folder in the Terminal window, use the rmdir command. The syntax of the command is as follows.
rmdir /s “Folder Path”
3 – For instance, you can type to delete a file in the C: folder.
Rmdir /s “C:\users\Foldername\TestFile”
4 – And that’s all! With this command on Windows, you may delete any file or folder.
Close All Apps
Be careful to close any open windows and apps. Then, reboot your device, open the File Explorer app, try deleting the file, and see if the issue remains.
Restart File Explorer App
1 – Press Control + Shift + Escape to open Windows Task Manager.
2 – On the Task Manager’s “Processes” tab, look for “Windows Explorer.”
3 – Choose “Restart” by right-clicking it.
Run SFC Scan
SFC (System File Checker) is a Windows utility that analyses and repairs faulty system files on your device. Follow these instructions to run an SFC scan on your Windows Computer.
1 – Open Command Prompt in admin mode.
2 – Type the following command and press Enter in the Terminal window.
3 – The scan may take several minutes to finish, and it will automatically fix any damaged or missing system files it finds.
Run Disk Scan
CHKDSK (Check Disk) command for Windows helps resolve various file system issues, including file corruption, faulty sectors, cross-linked files, and missing disk clusters. Follow these simple steps to run a disk scan on Windows 11.
1 – Launch the Command Prompt and run the following command.
Chkdsk /f /r c:
Note: The “/f” option instructs CHKDSK to fix any disk errors it finds on your device automatically.
Remove Read-Only Attribute
You must remove the read-only attribute to delete a folder or its contents marked as read-only.
1 – Windows may throw the “Directory is not empty” error if the file or its contents are marked as read-only.
2 – To remove the read-only characteristic, right-click the folder, choose “Properties,” and uncheck the “Read-only” option.
The Bottom Line:
Here are several easy yet effective remedies to fix Windows 11’s “Directory is not empty” error. You can attempt the probable fixes listed above to fix this issue. Additionally, you can use System Restore or reset your device if these solutions do not work. Was this article useful? Did you fix the error code 0x80070091? Please share your ideas in the comments section.