Error 0x80070091 can occur on Windows when attempting to delete a folder, displaying the message “An unexpected error is keeping you from deleting the folder. Error 0x80070091: The directory is not empty.”
Although the error notification makes it plain that you can’t delete a folder you tried to delete, the part that says “the directory isn’t empty” can leave you perplexed as to what the message actually means.
If the error is preventing your computer from functioning properly or affecting your productivity, then you’ve come to the right place. In this guide, we’ll discuss what this error is about and how you can resolve it.
What Is Windows Error 0x80070091?
This error can be confusing because it can appear in different scenarios. One of the common situations in which this issue appears is when you are deleting or moving a folder. Other users who experienced the same issue did so while transferring files from an external device or backing up their data.
In this case, you’ll get the following message pop up:
- Interrupted Action.
- An unexpected error is keeping you from deleting the folder. If you continue to receive this error, you can use the error code to search for help with this problem.
- Error 0x80070091: The directory is not empty.
This problem can be found on PCs running Windows 7 all the way up to Windows 10/11. It’s unclear what’s causing the issue, but it’s most likely caused by corrupted sectors on the external drive or corrupted data that can’t be erased.
Error 0x80070091: The directory is not empty can also appear when using System Restore. The Windows System Restore function allows you to go back to any point in time that you specify after creating a System Restore point. It’s a method of creating a backup plan in the event that your computer fails.
But when you encounter the 0x80070091 system restore issue, you’ll get a message that says:
- System Restore failed while restoring the directory from the restore point.
- Source: AppxStaging
- Destination: %ProgramFiles%\WindowsApps
- An unspecified error occurred during System Restore. (0x80070091)
The issue appears during the System Restore process when you try to restore your machine to a previous point and prevents you from successfully conducting a System Restore.
What Causes Error 0x80070091: The directory is not empty?
If you are deleting a file or folder from any section of your computer when you encounter this error, then you might be dealing with:
- Administrative issues which prevent you from deleting any file or folder.
- Bad sectors in your computer’s hard drive.
- Corrupt or damaged drivers.
- Too many junk files in the temporary locations folder.
As a workaround, you can try deleting the folder via Command Prompt.
To delete a folder, follow these steps:
- Launch Command Prompt as administrator.
- Type in the following commands in the CP windows and hit the Enter key after typing each line:
icacls #/grant *: F
Note: # denotes the complete path and name of the folder you failed to delete; * denotes the Administrator account’s username.
If you come across error 0x80070091 windows 7 while using System Restore, then a problem with the WindowsApps folder is causing the error. The 0x80070091 system restores problem indicates that the destination directory isn’t empty. So, throughout the System Restore procedure, there’s a folder under WindowsApps that should be empty but isn’t. This could be due to an antivirus program stopping the process or Sync Settings. But, because this is happening with the most recent versions of Windows 10/11, we can’t be sure what’s causing the problem.
The traditional solution is to simply delete or rename the WindowsApps folder, but TrustedInstaller is the only way to access it. As a result, you are unable to access or modify this folder. In this tutorial, we’ll try to uninstall all antivirus software before running System Restore without any other apps interfering. If that doesn’t work, the next step is to get inside the WindowsApps folder and rename it so that the System Restore process may continue.
Knowing the reasons behind the error: 0x80070091 allows the affected users to formulate a better strategy to successfully resolve the problem.
How to Resolve Error 0x80070091: The directory is not empty
Although the problem may appear to be a minor issue at first, it can prevent you from performing some computer operations. As a result, it is critical that you fix it as soon as possible. Depending on the cause, you can remedy it in a variety of ways.
Method 1: Run the SFC Tool.
The built-in System File Checker tool can aid in the resolution of the error. The utility checks for faulty files that may be the source of the error and attempts to repair them.
- Start by pressing the Start button.
- In the Search applications and files box, type cmd.
- To open Command Prompt with admin rights, press the CTRL + Shift + Enter combination.
- Type SFC /scannow into the Command Prompt window and press Enter.
- Restart your computer when verification is complete.
To see if the error has been fixed, wait for the tool to finish before attempting to delete the file or folder.
Perform a Check Disk Scan
The built-in disk check (chkdsk) software works similarly to System File Checker, except it focuses on correcting damaged sectors on hard drives. It can be extremely useful in fixing a variety of issues, including error 0x80070091. To perform a scan, follow these instructions:
- To access the menu, press Win + X.
- Select the Command Prompt (Admin) option.
- To run Command Prompt as an administrator, select Yes.
- Run the command chkdsk C/f/r/x.
- Hit Enter to start the scan, then wait for it to finish before restarting your computer and deleting the file or folder you want to delete to see if error 0x80070091 has been repaired.
Restart Windows Explorer
Windows explorer is a file manager that first appeared in Windows 95 and later versions of Windows. It allows users to manage files, folders, and network connections, as well as search for files and related components.
Restarting Windows Explorer can resolve the issue of being unable to delete a folder in Windows 10/11. The steps can be found below:
- On the desktop, right-click on the Taskbar and select Task Manager from the context menu.
- In the Task Manager window, go to the Processes tab and look for Windows Explorer.
- Right-click on it and select Restart from the menu, or select Windows Explorer and then click the Restart button in the Task Manager window’s lower right corner.
To see if the problem has been resolved, try deleting the folder. If you’re still getting a notice that the directory isn’t empty, try the solutions below.
The next step is to delete any antivirus software you may have installed on your computer. Antivirus software is known to interfere with these processes, preventing your machine from successfully restoring its system.
Use Windows Recovery Environment
A system restoration from the Windows Recovery Environment may also be successful, particularly if it has been interrupted by other processes.
- Press the Windows key once.
- Select Restart while holding down the Shift key.
- You’ll be sent to the Windows Recovery Environment screen after the machine restarts, where you can choose to Continue, Troubleshoot, or Turn Off your PC.
To get to the System Restore option from this environment, click Troubleshoot > Advanced Options > System Restore.
Now the computer will ask you to select the System Restore Point. Select the Restore Point that you want to go to and follow the on-screen instructions from there.
Run System Restore from Safe Mode
Safe Mode is a Windows feature that uses a simple interface and only executes the apps that are required. This way, you can be sure that no other programs like antiviruses are interfering with your System Restore.
- Press Windows > Power option.
- Press and hold the Shift key and hit Restart.
- Click Troubleshoot > Advanced Options > Startup Options > Restart.
- Your system will now restart and provide you with a number of options to choose from.
- To enter Safe Mode, press F4 on your keyboard.
Your computer will reboot to Safe Mode, which means that only the programs that are absolutely necessary will be operating, ensuring that there are no disruptions. Now conduct a System Restore by following the steps below.
- Hold the Windows key, then press the R key.
- Type in rstrui.exe and hit Enter.
- Click Next and select the restore point that you want to revert to.
- Click Next > Finish.
Now, wait for the system restore to finish.
Delete the WINDOWS.OLD Folder
Another effective method for resolving this problem is to delete the junk files on your computer. To do so, take these steps:
- Press and hold the Windows key while pressing R to open the Run box, then paste or type C:windowsSYSTEM32cleanmgr.exe into the run box and click OK.
- After that, choose a target drive and click OK; the Disk Cleanup will run automatically.
- Next, select Clean up system files and select Previous Windows installation from the drop-down menu, then click OK.
- Select Delete Files, which will remove the C:Windows.old folder.
The easiest way to remove junk files is to run Outbyte PC Repair so that you don’t miss anything. This tool will scan your computer for files that you don’t need and delete them while optimizing your processes and apps along the way.
The error “Error 0x80070091: The directory is not empty” may occur when you try to remove a file or folder or conduct similar activities on your PC. This article contains seven solutions for resolving this problem and should assist you in getting your computer back up and running.