Why are files not deleted from my laptop? Checking write protection

Good day.

While working at a computer, almost all users, without exception, have to delete various files. Usually everything goes quite simply, but sometimes...

Sometimes the file just won't delete, no matter what you do. Most often, this happens because the file is in use by some process or program, and Windows is unable to remove such a locked file. I get asked similar questions quite often and I decided to dedicate this short article to a similar topic...

How to delete a file that cannot be deleted - several proven methods

Most often, when you try to delete a file, Windows reports which application it is open in. For example in Fig. Figure 1 shows the most common mistake. In this case, deleting the file is quite simple - close the Word application, and then delete the file (sorry for the tautology).

By the way, if you do not have the Word application open (for example), you may simply have a frozen process that is blocking this file. To end the process, go to the task manager (Ctrl+Shift+Esc - relevant for Windows 7, 8), then in the processes tab, find this process and close it. After this, the file can be deleted.

Rice. 1 - a typical error when deleting. Here, by the way, at least the program that blocked this file is indicated.

Method number 1 - using the Lockhunter utility

In my humble opinion, the utility Lockhunter- one of the best of its kind.

Pros: free, conveniently integrated into Explorer, deletes files and unlocks any processes (even deletes files that Unlocker does not delete!), works in all versions of Windows: XP, Vista, 7, 8 (32 and 64 bits).

Cons: no Russian support (but the program is very simple, for most this is not a minus).

After installing the utility, simply right-click on the file and select “What is locking this file” from the context menu.

Rice. 2 lockhunter will start looking for processes to unlock the file.

Next, you simply choose what to do with the file: either delete it (then click on Delete It!), or unlock it (click on Unlock It!). By the way, the program supports deleting files even after restarting Windows; to do this, open the Other tab.

Rice. 3 selecting an action option when deleting a non-deletable file.

Be careful - Lockhunter deletes files easily and quickly, even Windows system files are not a hindrance for it. If you do not handle it carefully, you may have to restore the system!

Method number 2 - using the fileassassin utility

fileassassin

Official website: http://www.malwarebytes.org/fileassassin/

A very, very good utility for easily and quickly deleting files. The main disadvantage that I would highlight is the lack of a context menu in Explorer (each time you need to launch the utility “manually”.

To delete a file in fileassassin, run the utility and then point it to the desired file. Next, simply check the four boxes (see Fig. 4) and click the button Execute.

Rice. 4 deleting a file in fileassasin

In most cases, the program easily deletes the file (however, sometimes it reports access errors, but this happens extremely rarely...).

Method number 3 - using the Unlocker utility

A widely advertised utility for deleting files. It is recommended on literally every site and every author. That is why I could not help but include it in such an article. Moreover, in most cases it still helps to solve the problem...

Unlocker

Cons: There is no official support for Windows 8 (at least not yet). Although Windows 8.1 installed on my system without problems and works quite well.

To delete a file, simply click on the problematic file or folder, and then select the “magic wand” - Unlocker - from the context menu.

Rice. 5 Deleting a file in Unlocker.

Now you just choose what you want to do with the file (in this case, delete). Next, the program will try to fulfill your request (sometimes Unlocker offers to delete the file after Windows restarts).

Rice. 6 Selecting an action in Unlocker.

Method number 4 - delete the file in safe mode

All Windows operating systems support the ability to boot into safe mode: i.e. Only the most necessary drivers, programs and services are loaded, without which the operation of the OS is simply impossible.

For Windows 7

To enter safe mode, press F8 when you turn on the computer.

You can generally press it every second until a selection menu appears on the screen, in which you will be able to boot the system in safe mode. Select it and press Enter.

Rice. 7 Safe Mode in Windows 7

For Windows 8

In my opinion, the easiest and fastest way to enter safe mode in Windows 8 looks like this:

  1. Press the Win+R buttons and enter the msconfig command, then Enter;
  2. then go to the boot section and select boot in safe mode (see Fig. 8);
  3. save the settings and restart the computer.

Rice. 8 Starting Safe Mode in Windows 8

If you boot into safe mode, then all unnecessary utilities, services and programs not used by the system will not be loaded, which means that our file will most likely not be used by any third-party programs! Therefore, in this mode, you can fix malfunctioning software and, accordingly, delete files that are not deleted in normal mode.

Method number 5 - using bootable LiveCDs

Such disks can be downloaded, for example, from popular antivirus websites:

LiveCD/DVD is a boot disk that allows you to boot into the operating system without having to boot from your hard drive! Those. Even if your hard drive is clean, the system will still boot! This is very convenient when you need to copy or view something on your computer, but Windows crashes, or there is no time to install it.

Rice. 9 Deleting files and folders using Dr.Web LiveCD

After loading from such a disk, you can delete any files! Be careful because... in this case, no system files will be hidden from you and will not be protected and blocked, as it would be if you were working on your Windows operating system.

That's all. Using several methods above, you can delete almost any file from your computer.

The article has been completely revised since its first publication in 2013.

Good luck!

Deleting folders and files is a fairly simple procedure that does not cause any difficulties even for novice users. However, sometimes there are situations when folders are not deleted. In this article we will talk about how to delete a folder that cannot be deleted.

Method No. 1. Close the program that uses files from this folder.

If you are trying to delete a folder but it is not being deleted, then the first thing to check is the running programs. It is quite possible that one of the running programs is currently working with files from this folder. Typically, in such cases, the message “The operation cannot be completed because these folders or files are open in another program” appears.

If you suspect that a program can use files from this folder, then such a program should be closed. Then you need to try to delete the folder again.

Separately, it is necessary to say about antiviruses. It is not uncommon for antivirus software to block files that cause them suspicion. Such files cannot be opened or deleted. If you try to delete the folder in which such a file is located, you will also not succeed. In order to delete a file blocked by the antivirus, you need to pause the antivirus protection.

Method number 2. Rename the folder.

Another simple way is to rename the folder. It is not uncommon that the system does not allow you to delete a folder, but allows you to rename it. However, after renaming you can delete it.

Method number 3. Disconnect the computer from the network.

If files from a folder are used by other users on the local network, then you will not be able to delete the folder in which they are located. In order to solve this problem, you can simply disconnect your computer from the network and then delete the folder.

Method #4: Use an administrator account.

Administrator rights are required to delete some folders and files. If the system reports that you do not have enough rights, then you need to log into the administrator account and try deleting the folder again.

Method number 5. Restart your computer.

If the previous methods did not work, then simply restart your computer. In most cases, after a reboot, locked files and folders are deleted without problems.

Method number 6. Delete the folder using a special program.

There are programs for removing locked files and folders. The most popular programs of this kind are Unlocker, IObit Unlocker, LockHunter. Install one of these programs and try to delete the folder using it.

Method number 7. Delete the folder through Safe Mode.

You can also . Safe mode starts only the most essential components of the operating system. Therefore, in Safe Mode, most likely, the folder will not be locked and you will be able to delete it.

On Windows of any version (XP, 7, 8, 10), a problem often arises when a file or folder with a locked file is not deleted. A message pops up that the file is occupied by another process or is open in some program, or you need to ask permission from someone.

There are several ways to delete a file that is not deleted, renamed, or moved. This is done without additional software, using the free Unlocker program, from a bootable flash drive or LiveCD, or the DeadLock program.

When deleting locked files and folders, be careful; it may be part of the operating system. Without them, Windows will stop loading.

Why isn't it deleted?

  • The file is open in another program. Terminate any unnecessary processes and try again. Sometimes restarting the computer helps.
  • Insufficient permissions to delete. For example, this file was created by another user or the computer administrator removed the deletion rights.

Exceptions

The methods described in the article will not always help:

  • pagefile.sys and swapfile.sys - to remove, disable the swap file.
  • hiberfil.sys - deleted when hibernation mode is disabled.
  • If an access denied message appears. You need to become the owner of the file or folder. The easiest way to do this is with the TakeOwnershipPro program.
  • If a message appears asking permission from TrustedInstaller. This is protection against the removal of system components.
  • Windows.old - a folder with an old version of the operating system. It is deleted through the “Properties” of the local drive C. On the General tab there is a “Cleanup” button. A window will open in which select “Clean up system files.” Once the analysis is complete, the “Previous Windows installations” item will appear in the list in this window. Check this box and click OK.

Deleting the file manually

Message: The file is already in use, please close and try again.

If a file doesn't want to be deleted, the error message usually tells you which process has locked it. This could be explorer.exe or any program that has it open. If you close this program, the file will be deleted.

If the file is occupied by the explorer.exe process

  • Before completing the task, open Command Prompt as an administrator. It is located in “Start - All Programs - Accessories”. Right-click on Command Prompt and select Run as Administrator.
  • Remove the explorer.exe task in the task manager and write del full_path/name.extension in the command line.
  • The path does not have to be entered manually. Right-click on the desired file while holding Shift - Copy as path, and paste it into the command line through the right-click context menu.
  • Now restart explorer.exe. In the task manager, click "File - New task - explorer.exe".

Use a bootable USB flash drive or disk

If you have a bootable USB flash drive or LiveCD, or a Windows recovery disk, run them and calmly delete the file using the standard method or through the command line.


Be careful, sometimes when you log in through the boot disk, the local drives have different letters. To see a list of folders on drive C, type dir c: on the command line.

If you use a bootable USB flash drive or Windows installation disk, the console opens at any time after the language selection stage, using the key combination Shift + F10.

You can also select the system recovery mode, which will be offered before starting the OS installation.

Command for deleting via the console: del full_path_to_the_file.

Using DeadLock

The free DeadLock program allows you to delete a locked file and change the owner. Download from the official website: https://codedead.com/?page_id=822.

Using the File menu, add the problematic file to the program. Right-click on it in the list - unlock it (Unlock) and delete it (Remove).


Using Unlocker

The simplest and most popular program, but now even on the official website a warning about unwanted software is displayed. Along with the program there may be some other virus or advertising, so use at your own peril and risk. Try the methods above first. Website: http://www.emptyloop.com/unlocker/.

After installation, a new item will appear in the context menu, which is called Unlocker. After clicking the button, the program will complete the interfering process and the file will be unlocked.


If you want to delete a folder, first delete all its contents.

Via command line

There was such a case that the file did not want to be deleted in any way. The size was 0 bytes, the name was written in Russian letters (not supported in older versions of MS-DOS), there was a Read-only attribute and an A attribute (only reading and adding content). The command line helped.


That's all for now. If you know simpler and more effective ways, write them in the comments. Which method helped you?

If the computer reports that the file is open in another program

Most often, the inability to delete a file in Windows is due to the fact that it is occupied by some kind of system process. The message “The action cannot be performed because this file is open in “” appears. The name of the program».

In this case, you need to close the program that is using the file and try to delete it again. If you see her window, just close it. If a program is running in the background and you don’t know how to close it, launch “Task Manager” (Ctrl + Alt + Del), find this program by name in the list, right-click on it and select “End task”.

If you can't find the program you need in Task Manager, try a third-party utility that removes file locks. The free LockHunter app is suitable. After installing it, right-click on the file and select What is locking this file?. When the LockHunter window appears, click on the Unlock It! button.

After that, try deleting the file again. If unsuccessful, restart your computer and try again. To completely remove it from your computer, be sure to empty the Recycle Bin.

If your computer says you are denied access

Sometimes you cannot delete a file because your account does not have rights to do this. In such cases, Windows reports that access is denied. To resolve this issue, you need to change the owner of the file. During the process, you may need the login and password for your PC administrator account.

To change access rights, right-click on the file and go to “Properties” → “Security” → “Advanced”. Near the “Owner” item, click “Edit”, then “Advanced” and “Search”. Select your current account from the list and click OK.

After doing this, you will most likely be able to delete the file as usual. If it doesn't work, try restarting your computer and trying again.

How to delete a file on macOS

If the Mac says the file is in use

First, manually close the applications in which you used this file and try to erase it again. They can interfere with uninstallation, as happens in Windows. If unsuccessful, restart your computer and repeat the removal.

If it doesn't work, enter safe mode. To do this, restart your Mac while holding down the Shift key. Try moving the file to the Recycle Bin and emptying it, then restart your computer as normal.

If the file cannot be deleted for other reasons

The file may not be deleted due to disk errors. Therefore, launch “Disk Utility” in the Finder → “Programs” → “Utilities” section and check the disk on which the file is located using the “First Aid” service.

After checking, restart your Mac and try deleting the file.

Any computer user has at least once encountered a situation where, when trying to delete a folder (or file), the Windows operating system does not allow this, displaying a message stating that they are open in another program.

It would seem that nothing could be simpler: just close all active applications and the obstacles to deleting an unnecessary folder will be eliminated. But it often happens that even after closing all programs, the operating system still gives out the same annoying message.

There may be many reasons for this, the main ones being the following:

  • System error;
  • actual use of the object by another program;
  • data corruption;
  • use of a folder or file by the system;
  • presence of viruses or malicious files.

And deleting unnecessary objects is often simply necessary, since they take up space and sometimes can even significantly slow down the performance of the entire system as a whole. What to do in such cases?

How to delete a folder if it says that it is open in another program

If, after closing all programs and applications, the operating system continues to believe that the folder is occupied by another process, you will have to use more complex actions to delete it. There are several ways to solve the problem:

  • using the task manager;
  • using a special utility;
  • entering safe control mode;
  • using the console and special commands.
  • Since the reason why a folder cannot be deleted is not always obvious, you will have to apply these methods sequentially.

    Often the best answer to this question is to simply restart the computer. It’s not for nothing that professional programmers have a saying: “seven troubles – one reset.” Often, after restarting, any version of the operating system can easily delete unnecessary objects.

    Using Task Manager

    If even after a reboot the notorious message continues to appear when trying to uninstall, then most likely some program or application continues to work in “hidden” or “sleep” mode.

    In this case, turning to the built-in system task manager can help. It is called by pressing the key combination “Ctrl”, “Alt” and “Delete”. The window that appears will display all running applications and work processes.

    By switching between the corresponding tabs, you can stop the operation of a particular program by right-clicking on it.

    If it is not known which program is using the folder to be deleted, then the most effective way is to stop all running applications (“cancel task”). Then you should try to remove it again. There are still questions on the topic of how to delete a folder on a computer if the system says that it is open in another program, then read on.

    Note! Sometimes problems with deleting unnecessary objects are associated with blocked rights. Sometimes Windows requires the user to have higher hierarchical authority for operations with certain objects. In this case, you must log in as (or with rights) an administrator and the operation to delete the required objects will be successful.

    Application of special programs and utilities

    If the methods listed above do not have the desired effect, you can use a specialized program. One of the most popular, powerful and effective free utilities of this kind is Unlocker.

    Using this uninstaller is quite simple. After downloading and installing the program, when you select an object to be deleted with the right mouse button, the corresponding line appears in the drop-down context menu. All you have to do is click on it, select the “no action” option, click “delete” and confirm by clicking “ok”.

    After the manipulations have been performed, complete deletion of the unwanted folder should become available after a reboot.

    Other ways to delete folders and files

    There are alternative methods for deleting files and folders that require certain knowledge in using a computer, special programs and system files.

    1. Using Safe Mode. The advantage of this method is that in safe mode, Windows does not load system dialog libraries. This is important in cases where the system is infected with a virus. To log in, you must press the F8 key several times when you turn on the computer. Then you need to select “safe mode”. A black screen should appear, without wallpaper or other embellishments. Now you can try to delete the unnecessary folder in the usual way. After which you need to reboot the system.
    2. System rollback. When you click “Start” - “Run”, a command line appears, into which you need to enter the command “msconfig” and click “ok”. The “System Configuration” window will appear on the monitor. In the “General” tab, you need to select “Run System Restore”, then “Restore the computer to an earlier state”, then “Next”. On the calendar that appears, you need to select a date on which the folder to be deleted did not yet exist. This operation may lead to the loss of some information, but personal and system information will not be affected.
    3. You can try typing chkdsk c:/f/r in the command line and pressing Enter. Here "c" is the drive name. If the non-deletable folder is on another drive, then you need to enter its name. After the disk scan is completed, its results will be displayed on the monitor. Next, enter the command exit and press the Enter key. After the system reboots, you can try to delete the folder in the usual way.

    Thus, you can solve the problem of the inability to delete a folder or file when the Windows operating system (latest versions, starting with XP) writes that they are occupied by another program using various methods. Try to perform the operations listed above in order. Most likely, one of the methods will achieve the desired effect!

    Publications on the topic