Troubleshoot error 0x80070091 "Folder is not empty"

The appearance of various failures and bugs are not uncommon for Windows operating systems. Errors occur for various reasons, both software and hardware, they may be minor or directly affect the performance of the system. Almost all users encountered the problem of deleting files and directories, and they know that it is impossible to perform the procedure while the element is being used, involved in any process at the current moment or in the absence of access rights. So, with the renaming, the completion of the process, the involvement of utilities for unlocking, shredders, obtaining rights or loading from an external drive such as LiveCD, the problem is usually solved. In this case, in the case of a “Folder is not empty” error with the code 0x80070091, these actions are not always effective. Failure often occurs when using the recovery function of the OS, for example, when you try to return to the created point or re-create it. Let's take a closer look at what caused this problem, and how you can deal with it.

Resolving error 0x80070091 when deleting a folder.

Causes of Error 0x80070091

Correction of any failure is aimed at eliminating the source of its occurrence. So with the error "The folder is not empty", having the code 0x80070091. If the directory is occupied by a process, everything is simple, you can delete it, freeing it from the task, including using the system reboot method. Another thing is if the problem is more serious and is caused by damage to the file system of the hard drive, which can in turn be triggered by a number of factors, starting with update curves, unsuccessful software installation / uninstallation, or the presence of viruses, resulting in integrity problems due to physical malfunctioning of the hard disk. Considering the “Folder is not empty” error, two variants of its manifestation can be identified - in the process of restoring the OS, when there are problems with the content and registration of applications in the Windows Apps directory, or when trying to delete any folder. Failure notification, as a rule, may contain additional information.

In our case, the location of the problem item is indicated here - the directory located in the Program Files directory - Windows Apps. It is in it that the data for recovering the operating system reside, and there may also be remnants of previously installed versions of the system. The problem of deleting a folder occurs for various reasons. For example, the object continues to be used by the current Windows, which implies the need to complete the process to perform the operation or the system blocks access to Windows Apps. In addition, a large-scale distribution of failure was obtained after updating the HF 3213968 (regular OS updates are famous and not for such surprises). There will be several ways to fix the error 0x80070091 due to the fact that the problem may be associated with various provoking factors. Since the exact cause of the failure is not known, applying each solution in turn, you can achieve the desired result.

We correct the error

If you are trying to delete a folder while any applications are working with it, the appearance of a failure with error code 0x80070091 is quite natural. So, the processes must be completed and in the case when the software is still using the object, it is necessary to disable the working software, including in the background.

System boot in clean mode

The clean boot state is used when troubleshooting problems with Windows. So, using this solution, you can select a minimum of drivers and programs with which the operating system will boot, and then return to the recovery procedure. For a clean boot, do the following:

  • Go to the system configuration (click Win + R and type msconfig in the "Run" console line).
  • In the window that opens, in the “General” tab, select “Selective Startup”, where the ability to start system services should be marked, while the “Load startup items” option should be checked.
  • Go to the "Services" tab, where you should check the "Do not display Microsoft services" item at the bottom of the window.
  • We press the button “Disable all”, confirm the action and boot into the clean boot mode of Windows.

We try to restore the system, returning it to the previously created point. The mode is deactivated in the reverse way.

Rename folder

This simple solution method is to rename the Windows Apps system directory. To do this, perform the following manipulations:

  • We change the name of the Windows Apps folder, but first we need to get the rights to modify the object. Run the command prompt under the administrator account, where we enter the command TAKEOWN / F "C: \ Program Files \ WindowsApps" / R / D Y.
  • We are waiting for the end of the process, it will take some time, after which we close the console.
  • Go to the conductor, where in the settings we enable the option to display system elements (in the parameters, select the item "Show hidden files, folders and drives").
  • Now, using the Unlocker tool (to perform the manipulations, its portable version is enough), select the Windows Apps folder and click Rename, specify the new name, then click the Unlock All button.

The procedure allows you to rename the folder, which in some situations will help to cope with the failure and the next attempt to perform the OS recovery is successful. Sometimes it is possible to achieve success in removing the directory from under the LiveCD, while if the file system contains errors, further problems are likely, so we will affect a possible source of trouble.

Scan hard disk errors

The system utility CHKDSK (Check Disk) allows you to scan a disk for errors, bad sectors and eliminate detected faults. You can run the tool using the command line. You need to open it as an administrator via the Run console, where you can enter the cmd command in the field and press Ctrl + Shift + Enter. The same can be done by using the search from the Start menu, then in the output results you need to press RMB on the utility name and select the desired tool loading option. We proceed to the procedure:

  • In the command line, open for administrator rights, enter the command chkdsk C: / f / r.
  • Instead of the value “C: /” it is necessary to substitute the name of the disk where the system is located. The value of f in the command means to check for errors and correct them when it is detected. The / r parameter is responsible for searching for bad sectors and restoring their contents.
  • The next time you start the system, the utility will start working (checking a non-system disk does not require a reboot), you will need to wait some time until the process is complete.
  • In the final report you will see the result of the check.

Often this method solves the problem of error 0x80070091, because if the file is recorded on a damaged section, it is not accessible to it. For the contents of the sectors to be read and, if necessary, deleted, it is necessary to restore the file system data.

Change the point of return

It happens that it is impossible to return to a saved point solely due to the deletion of a specific directory. In this case, the problem will return to an early point. Since during the operation of the OS there are a lot of conflicts, they subsequently provoke various errors and bugs. We are returning the system to an earlier state, when such problems did not arise, using the standard Windows recovery functionality, and it is quite likely that the 0x80070091 error will no longer disturb.

Opening access to Windows Apps

Another option is how to delete a folder, if this is prevented by a failure with the code 0x80070091, involves obtaining access to a locked object, which will provide the ability to restore the system or delete files. Perform the following:

  • Go to the Program Files and in the "View" tab of the explorer open the "Options".
  • In the “Folder Options” window, go to the “View” tab, where, in the advanced settings block, mark “Show hidden files, folders and drives”.
  • Now the Windows Apps folder is displayed, click on it with the RMB to go to the object properties, select the "Security" and "Advanced" sections.
  • Click "Continue", find the option "Change", enter the name of the administrator at the bottom of the window and click on the name verification, confirm the action. It is also necessary to note the item on the replacement of the owner.
  • In the "Security" section of the folder properties, select the administrator by ticking the "Full access" option.

Conclusion

After the performed manipulations, you will have the full right to change the Windows Apps folder, you can rename it (see above), reboot the device and try restoring the system again. Error 0x80070091, although it is not critical, gives a lot of inconvenience, while the methods described above are sufficient to correct the failure.