How to Delete a File That Is Open in Another Program

Computers are multi-tasking marvels, but sometimes you need to delete a file already open in another problem. If you’ve received the error message, “The action can’t be completed because the file is opened in another program,” you’re in the right place.

How to Delete a File That Is Open in Another Program

This article will outline different methods to delete that file, even if Windows uses it in another program.

Try Closing the Program

One of the most straightforward fixes for deleting a file used in another program is to close the program using it. If the file you want to delete is in an “exe” file of a program, try closing the program first, then attempt to delete the file again.

You can also try restarting your PC to close down any running programs or closing the apps that might be using the program you want to delete. For example, if you want to delete a video, make sure the video player is closed.

Follow these steps to find out how to close the program that’s running:

  1. Search for the app “Run” in your Windows search bar.
  2. In the “Run” window, type in: Resmon.exe
  3. Open the Central Processing Unit (CPU) tab in the top-left corner and select the optional processes.
  4. Expand the “Associated Handles” option by clicking on an arrow at the right corner.
  5. Look for the file you want to be deleted, then close the process with the handle.

Empty Recycling Bin

If the error keeps happening, you might be able to solve it by cleaning up the computer’s recycle bin.

To empty your recycling bin, do the following:

  1. Right-click on the “Recycling Bin” icon.
  2. Pick the option “Empty Recycling Bin.”
  3. Try deleting your file again.

End the Windows Explorer Process and Restart It

Sometimes, files can become locked, but closing Windows Explorer can provide a temporary fix. After ending the File Explorer Process, you can proceed with deleting your file.

If you want to try out this option, follow the next steps:

  1. Find Task Manager in the search bar or press the “Ctrl + Alt + Delete” shortcut.
  2. In the “Processes” tab, find “Windows Explorer” and click the button “Restart” at the bottom-right corner.
  3. Reopen Task Manager and go to the “Details” tab at the top-right corner.
  4. Find the “explorer.exe” file, select it, and press the “End Task” button.
  5. Go to “File” and press the option “Run New Task.”
  6. Enter “Explorer,” and press Enter.
  7. Select the “OK” button.

Disable Windows Search

If “Windows Search” is causing this problem, you can solve it by disabling it altogether. However, if you’re using this option frequently, you should probably skip it and move to the next solution.

  1. Type “Indexing Option” in the search bar and open it.
  2. Press the “Modify” option.
  3. Disable indexing locations by unchecking them all, then press “OK” to save changes.
  4. Open the “Services” app, locate the “Windows Search” on the drop-down list, and double-click it.
  5. Set the ‘Startup” to “Disabled.”
  6. Click the “Stop” button to stop the service.
  7. Press “Apply” and “OK” to save your changes.

Using Optimize to Enable Deleting a File

To solve the error that keeps occurring when you attempt to delete a file, maybe all you have to do is use “Optimize” as an option. Follow the next steps to find out how:

  1. Open the directory that holds the file.
  2. Right-click on the empty space in the window and choose the “Properties” option.
  3. Go to the “Customize” tab at the top-right corner and select the option “Optimize This Folder.”
  4. Check the box: “Also Apply This Template to All Subfolders.”
  5. Click “OK” and “Apply” to save your changes.

Check if the Program Is Running in the Background

Some programs might keep running in the background even when you close them due to various tasks set to run. To check if the program you want to delete is running in the background, check out these steps:

  1. Open the “Task Manager” via the search bar or use the “Ctrl + Alt + Delete” shortcut.
  2. Click on the “Details” option at the bottom-left corner.
  3. Look for the program you want to delete in the “Processes” tab.
  4. Click on it and then choose the option “End Task” at the bottom-right corner.

You should be able to delete the file now.

Force-Delete a File in Use With Unlocker

If you don’t know which program the file you want to delete is using, you can try to unlock it with the Unlocker app. This app will stop the program from running the file, enabling you to delete it.

Follow these simple steps to find out how:

  1. Download Unlocker and follow the prompts to install it.
  2. Right-click the file you want to delete.
  3. Select the “IObit Unlocker” option from the menu.
  4. When “User Account Control” asks for permission, click “Yes” to proceed.
  5. Click on the file you want to delete, then click on the option “Unlock.”
  6. From the drop-down menu, click the setting “Unlock and Delete.”

If the file still won’t delete or unlock, repeat steps 1-4. Before doing the fifth step, check the box beside the option “Forced Mode.”

There is another way to force-delete the files from your device without using the “Unlocker.” Here’s how:

  1. In the Windows search bar, type in “Run” and open the app.
  2. Type “cmd” in the text field and press the “OK” button.
  3. After opening the Command panel, type in: “del / f (insert file name you want to delete)

Use Disk Cleanup

In some cases, you might be unable to delete a specific file because of the thumbnails. You can fix this problem by deleting them with “Disk Cleanup.”

Follow these steps to find out how:

  1. Search for the “Disk Cleanup” app in the search bar and launch it.
  2. Select your system drive and click: “OK.” Your computer will begin to scan the drive, so you will have to wait a couple of seconds.
  3. Once the scanning is complete, find the thumbnails in the “Files to Delete” option and check the box.
  4. Press the “OK” button and wait while the “Disk Cleanup” removes the selected files.

You should be able to delete your file after this. If the problem reoccurs, repeat the process.

Turn Off the Preview Pane in File Explorer

The preview pane in “File Explorer” can also cause this error when deleting files, but disabling it can resolve the file deletion issue.

  1. Open “File Explorer.”
  2. Select the “View” tab.
  3. Click on the “Preview” pane to close it.
  4. If the “Preview” pane is blue, click on it to disable it.

Errors Disarmed, Files Removed

There are various ways to solve the deletion issue when your computer is using a file in another program. Unfortunately, there’s no easy fix, but each solution is relatively simple to execute. And now you have an arsenal of solutions at your disposal for the next time you see that dreaded message.

Do you have a favorite method to delete files when you see this error message? Share your experience in the comment section below.

Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.