How to delete a file or folder if it is not deleted? Why is it sometimes impossible to delete even an empty folder from the Recycle Bin or Desktop? The disk is full or write-protected.

A common problem that novice users encounter is that a file or folder is not deleted (due to some file) that needs to be deleted. At the same time, the system writes the file is occupied by another process or The action cannot be performed because this file is open in ProgramName or that you need to ask permission from someone. This can be encountered in any version of the OS - Windows 7, 8, Windows 10 or XP.

Another way to delete such a file is to boot from any LiveCD drive, system recovery disk, or Windows bootable USB flash drive. When using LiveCD in any of its variants, you can use either the standard Windows graphical interface (for example, in BartPE) and Linux (Ubuntu), or command line tools. Please note that when booting from such a drive, the computer's hard drives may appear under different letters. To ensure that you are deleting a file from the correct drive, you can use the command dirc:(this example will display a list of folders on drive C).

When using a bootable USB flash drive or installation disk for Windows 7 and Windows 8, at any time during installation (after the language selection window has already loaded and in the following steps), press Shift + F10 to enter the command line. You can also select "System Restore", a link to which is also present in the installation program. Also, as in the previous case, pay attention to possible changes in drive letters.

Using DeadLock to Unlock and Delete Files

Since the Unlocker program discussed below, even from the official website, has recently (2016) begun to install various unwanted programs and is blocked by browsers and antiviruses, I propose to consider an alternative - DeadLock, which also allows you to unlock and delete files from your computer (it also promises to change the owner, but in it didn't work in my tests).
So, if when deleting a file you see a message that the action cannot be performed because the file is open in some program, then using DeadLock in the File menu you can add this file to the list, and then, using the right click - unlock it (Unlock) and remove it (Remove). You can also move the file.
The program, although in English (perhaps a Russian translation will appear soon), is very easy to use. Disadvantage (and for some, perhaps an advantage) - unlike Unlocker, it does not add the action of unlocking a file to the Explorer context menu. You can download DeadLock from the official website http://codedead.com/?page_id=822

Free Unlocker to unlock files that won't be deleted

The Unlocker program is probably the most popular way to delete files that are used by a particular process. The reasons for this are simple: it is free, it does its job properly, and in general, it works. You can download Unlocker for free on the official website of the developer http://www.emptyloop.com/unlocker/(the site has recently been identified as malicious).

Using the program is very simple - after installation, just right-click on the file that is not being deleted and select “Unlocker” from the context menu. If you are using the portable version of the program, which is also available for download, launch the program and a window will open to select the file or folder you want to delete.

The essence of the program is the same as in the first method described - unloading from memory the processes that are occupied by the file. The main advantages over the first method are that using the Unlocker program it is easier to delete a file and, moreover, it can find and terminate a process that is hidden from the eyes of users, that is, not viewable through the task manager.

Update 2017: Another method, judging by the reviews, works successfully, was proposed in the comments by the author Tokha IT specialist: install and open the 7-Zip archiver (free, it also works as a file manager) and rename the file in it, which is not deleted. After this, the removal is successful.

Why is the file or folder not being deleted?

What may be preventing you from deleting a file or folder?

If you don't have the necessary system rights to change a file or folder, you can't delete it. If you didn't create the file, then chances are you can't delete it. The reason may also be settings made by the computer administrator.

Also, a file or folder containing it cannot be deleted if the file is currently open in the program. You can try closing all programs and try again.

Why when I try to delete a file does Windows say the file is in use?

This error message means that the file is being used by the program. Thus, you need to find the program that uses it and either close the file in it, if it is, for example, a document, or close the program itself. Also, if you are working online, the file may be currently in use by another user.

After deleting all files, an empty folder remains

In this case, try closing all open programs or restarting the computer, and then deleting the folder.

Sometimes when you try to open a folder, you may receive an error message. Let's figure out what can be done if there is no access to the folder.

The reasons that a folder cannot be opened are very different, but I will try to tell you about each of them and instruct you on what to do in each case if access to the folder is denied. To begin with, I must say that everything The following actions must be performed using an administrator account.

You are not the owner of the folder

After reinstalling or updating Windows, you may no longer be listed as the owner of a folder, so the system quite reasonably prevents you from reading files that do not belong to you.

Now I will tell you how to access the folder in this case. First, go to the “Control Panel” menu item and there select “Folder Options” or “Folder Options” depending on the system.

In the “View” tab, find the item “Use the sharing wizard (recommended)”, if you have Windows 7 or XP, if Windows 8 - “Use simple folder sharing (recommended)”, uncheck the box, click “OK”.

Now right-click on the folder and select “Properties” from the drop-down menu. In the “Security” tab, click on “Advanced” and in the new window, click on the “Owner” tab at the top of the window. At the bottom left click “Change”.

It is possible that you will not have such a tab. Then you need to go into safe mode and then follow the steps described below.

In the window that opens, select the username you want to allow access to and click “OK.” To gain access not only to the folder, but to all the files and folders inside, we selected the “Replace owner of subcontainers and objects” option and then clicked “OK”.

As you can see, there is nothing complicated. The very essence is that the owner of the folder has changed and to fix this, you need to indicate yourself as the owner. It's a different matter when you encrypted data and after reinstalling Windows you decided to open this folder. Then your head might just explode, but your problem can be solved and you don’t have to worry! Hopefully, after following my instructions, you are no longer denied access to the folder you need.

By the way, if such an error appears when opening a flash drive or disk, be sure to check your computer for viruses.

Here is another option, from the person who posted the video:

It happens that you simply need to delete a folder or file, but Windows does not allow you to do this and writes about errors like “this process is busy” or “the folder is not empty” or something else. Maybe you found some folder or file that you “didn’t like” and want to delete it. Maybe you know for sure that this is “unnecessary junk” that only takes up space, but Windows curses and does not allow it. In general it's not that important Why can't I delete it?, How many How to delete and in this article you will find answers to this question.

Most often, such situations occur due to the fact that the files being deleted are occupied by other programs. But it also happens that it is impossible to delete a file even after closing all applications that can use this file. For example, a file or folder may become locked due to incorrect user actions and cannot be deleted in any way. These folders (files) remain “hanging” on the hard drive, take up space, and are not opened or deleted.

The file may not be deleted due to a failure that occurred during the process of writing or overwriting it. If you interrupt the recording process, the file is not completely saved, resulting in invalid entries in the file system. And our beloved Windows, not knowing how to handle it, simply closes access to it, supposedly for security reasons.

So, let's start dancing with a tambourine!

Why is the file not deleted?

1) The file was blocked by an antivirus program. This often happens when an antivirus quarantines a file. Or the antivirus detected a malicious program, but treatment was postponed (waiting for its databases to be updated). In this case, in order to avoid infecting the computer, the user is blocked from accessing this file. Check the quarantine of your antivirus program and delete the file using the antivirus itself, or disable the antivirus and delete the file manually.

2) The file is being used by another program. Think about what programs might use this file. Close them and try deleting the file again. If this doesn't help, use Task Manager to check the list of processes to see if the program is still running.

3) Administrator rights are required to delete a file. If you are running under a user account, log in again as an administrator and try deleting the file.

4) The file is being used by another user on the local network. Please wait and try deleting the file later.

5) The file is being used by the system. Try deleting the file after restarting your computer or in safe mode.

6) The device is write protected. For example, SD memory cards and some USB flash drives have a special switch to lock the device.

There are several removal methods, I will start with the simplest and most effective and gradually move on to more complex ones.

1. Method:

Reboot

We programmers have a saying: “7 troubles - one reset.” You can figure out what it means yourself

But the point of the method is that you need to restart the computer and try to delete the file/folder again.

2. Method:

Safe mode

You need to log in in Safe Mode.

What is the benefit of booting the system in safe mode? The thing is that Windows does not load its libraries to execute dialogs. To put it simply, if you have a virus on your computer (and this is possible), then in this safe mode it will not perform any actions. There is nothing superfluous in this mode, just pure OS and people.

In order to enter this mode, when you turn on the computer and after loading the BIOS (or in general you can from the very beginning of the “black screen” boot), press the key intensively without ceasing F8(no need to press and hold!!!). A black screen will appear in which you need to use the keys on the keyboard to select Additional boot options, and then Safe Mode (or just Safe Mode, you don’t need to select all sorts of things with command line support and so on. And that will do) and press Enter. If you did everything correctly, the system will boot and in the lower right corner there will be an inscription Safe Mode (it may also be in all corners). Don't be afraid of the black screen that will appear) without wallpaper and beauty.

Now you need to find the file that you just couldn’t delete and try to delete it. In any case (it worked or not), reboot.

3. Method:

Through the Unlocker program

It is precisely for such purposes that the good guys wrote such a program called Unlocker. This is a very small, free program for unlocking files running on Windows. This utility allows you to close open file blockers, thereby making it possible to perform further actions on these files. Those. the program shows all processes blocking a file (folder) and can delete it, despite all the blockers.

In addition, the program allows you to rename files and their extensions or move a locked file to another location. This is also very convenient, because... Windows does not always allow you to do this quickly and calmly.

When installing, DO NOT agree to the proposed toolbar (or you really need it, then click Next) and uncheck Install Babylon Toolbar - RECOMMENDED. Otherwise, the installation is normal - everywhere Next I Accept Install and that’s it)

Just right-click on the file that is not being deleted (not moved/renamed) in the usual way and select the program icon from the menu. A window should appear in which you select Delete from the list and press the button OK.

If the file or folder is blocked, another window will appear. First you need to press the button Unlock everything, and then Delete.

For those who don’t know what the bit depth is on the system, read

4. Method:

Through file managers

Of all the most popular and frequently used file managers, the most popular is Total Commander.

File managers have the ability to bypass some Windows restrictions, which we will use.

To delete a non-deletable file, we will need to download one of these file managers, FAR or Total Commander (I use Total Commander Podarok Edition). After downloading and installation, find your file in the list of directories and delete it by clicking either the right mouse button and selecting Delete, or pressing the Delete key on the keyboard.

These managers also have a good opportunity to see everything that is hidden and encrypted (especially in different colors, like mine). If your folder is not deleted, then go into it through the manager and see what’s there. If you see a hidden file, it means it is interfering. Then launch Task Manager ( ctrl+shift+esc), go to the Processes tab and look for this file in the list (it’s also good to click on the button at the bottom left of the Display the processes of all users manager), find and finish (del or RMB -> End process or the End process button in the lower right corner). The application is the same with files, we look for the file name and “kill”.

5. Method:

Another option with Unlocker

If your folder is not deleted, it says something like “the folder is not empty,” then create a new folder on the same disk, transfer the non-deletable folders to the new folder, delete the new folder using Unlocker

6. Method:

Using startup

Click “Start” => “Run” => In the “Run” line, enter msconfig => Click OK. You will see the System Setup window. Go to the “Startup” tab and in the list of downloadable items, find a name similar to your “not deleted” file.

If there is no such file in the list, then click on the “Disable all” button. Click on the “Apply” => “Close” button. The operating system will issue a warning that all changes made by the system setup program will take effect only after rebooting the computer. Click the "Reboot" button. The computer will restart. After downloading, try deleting the “undeletable” file again.

7. Method:

Using System Restore

In the “System Settings” window (which was the same as in the previous paragraph), select “General”. Click on the “Run System Restore” button. In the window that appears, select the option “Restore the computer to an earlier state”, click “Next”. In a new window, you will see a calendar in which you can select a system restore date. Select a date when the "not deleted" file was not on the computer. Click "Next". Don't worry, System Restore will not affect your personal files.

8. Method:

Lack of access rights to delete files

Right-click on the problematic object and select "Properties" from the drop-down list

In the window that opens, select the “Security” tab

Highlight your name in the list and select "Full Control"

- “Apply” and “OK”

Trying to delete

9. Method:

Use a different operating system.

Try booting from a removable disk (or CD/DVD) (LiveCD or LiveUSB) with a different operating system. Then delete the file/folder.

10. Method:

Move somewhere.

Sometimes it helps to move (cut) the folder to an empty flash drive and then format it.

11. Method:

In the window, type the command chkdsk c: /f/r and click Enter, it should be taken into account that c: is the name of the disk that needs to be checked. If the drive you are checking has a different letter, then write it.

If the drive being checked is C:, then when you press Enter You will be prompted to check it the next time you reboot. When asked whether to check or not at the next reboot, enter Y and press Enter.

If the disk name is different, the scan will begin immediately. At the end of the check, the result of the check will appear. Type exit and click Enter.

Now you can delete a file that you did not want to delete. In the case of drive C, simply restart the computer and after checking, delete the non-deletable file.

12. Method:

If you open the command line via Start - All Programs...run the process as an administrator (RMB and Run as Administrator) and move to the folder with the non-deletable file (or folder) using the cd \ command in order to be in the root directory disk, and then cd folder_name to go to the desired folder.