3 Ways to Delete a File That Refuses to be Deleted

Novice users have a frequent problem: The file or folder he or she wants to delete simply cannot be deleted. The most common error message the user will see when this happens is a Windows alert dialogue box that says the file is being used by another process or the action cannot be executed because the file is open in another program.

Fortunately, there are several ways to remove such files, each of which will be considered here. First, let’s see how to delete files without using third-party tools. Then I’ll describe how to remove those files using the free software utilities, LiveCD and Unlocker.

Please note that the deletion of files, especially those in use, is not always safe. Be careful about what you’re going to delete.

Delete file that cannot be deleted

Deleting a file without any additional software

Usually, if the file cannot be removed, in the alert message you’ll see the name of a Windows process that uses that file. The process can be explorer.exe or any other program or process. It’s logical to assume that you’ll need to close the program or process before you can remove the file.

That’s easy to do; just start the task manager:

  • In Windows 7 and XP, do this with the key sequence Ctrl+Alt+Del.
  • In Windows 8, you can press the Windows key + X and then select Task Manager.

Locate the process and click “Kill task,” then delete the file. If the file is in the process explorer.exe, then before you can remove the task in Task Manager, you’ll have to open a command prompt as administrator and, after the process is stopped, use the command prompt del file_path to remove the file.

To return to the standard desktop view, you may need to restart explorer.exe: In the Task Manager, select “File” – “New Task” – “explorer.exe.”

Using Live CD or Bootable USB stick to delete a file

Another way to remove a file after receiving the Windows alert that the file is in use, is to boot from almost any LiveCD or bootable USB drive. When using any version of LiveCD, you can use either the standard GUI Windows (for example, WinPE), Linux (Ubuntu), or a command-line tool. Note that when booting from these drives, hard drives may have drive letters assigned that are different from when booting Windows normally. To make sure that you delete a file from the desired disc, you can use the command dir c: to displays a list of folders on the C: drive.

When using a bootable USB drive or Windows installation disk, at any step of the setup process press Shift+F10 to enter the command line. You can also select “System Restore” link on the first or second screen of the installation program (the one with the Install button in the center). As in the previous case, note the possible drive letter change.

Unlocking files with Unlocker freeware

Unlocker free software is probably the most popular way to delete files that are in use by a program or process. It should be popular: It works well, it’s simple, and it’s free. You can download Unlocker free of charge on the developer’s official website: http://www.emptyloop.com/unlocker/.

Using the program is very simple: After installation, simply right-click on a file that cannot be deleted, and click the menu item “Unlocker.” If you are using the portable version of the program, also available for download, simply run the program and a window will open to select the file or folder that you want to delete.

The program works in the same manner as the first method described: it unloads from memory processes that are using the file. The main advantage of Unlocker over the first method described is that it’s an easier process overall, plus it can find and close processes which are not visible in Task Manager.

Why a file or folder cannot be deleted

Here’s a little background information from the Microsoft Website, if you’re interested.

What could interfere with the removal of a file or folder?

If you do not have the required system permissions to change the file or folder, you cannot remove it. If you did not create the file, then, chances are, you can’t remove it. Further, the reason may be dependent upon settings made by the system administrator.

Also the file or folder containing the file cannot be deleted if the file or folder is currently open in any program, process, or service that the computer is running. You may find that closing all programs, restarting, and trying to delete the file again will succeed.

Why, when I try to delete a file, does Windows say that the file is being used?

This error message indicates that the file is used by a program. For example, if the file is a document or spreadsheet, you can try exiting the application. You may also find, if you’re on a network, that the file may be being used by someone else at the moment.

After all the files have been deleted, there remains an empty folder

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

Leave a comment