Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Windows»How to Delete a File That is Open in Another Program

How to Delete a File That is Open in Another Program

Deep ShresthaBy Deep ShresthaNovember 26, 2022
how to delete a file that is open in another program

Deleting a file is a simple process as long as a program is not currently using it. You cannot delete a file if a program currently uses it. You will need to close the program or process that is using the file and then delete the file to complete the deletion process.

Although closing the program will work in most cases, it may not work if a critical windows process uses the file you want to delete. Besides this, you are also bound to get this error message when this program runs in the background. In that case, you may need to follow specific solutions to delete these files.

Table of Contents

  • How to Delete a File That is Open in Another Program?
    • Check Resource Monitor
    • Close the program Via Task Manager
    • Close the Process using Process Explorer
    • Delete from Command Prompt
    • Restart the PC and Delete
    • Restart Windows Explorer
    • Delete Temporary Files
    • Turn off Caching of Thumbnails
    • Change File Explorer Settings
    • Delete Files in Safe Mode

How to Delete a File That is Open in Another Program?

When you get this error message while deleting a file, first close all the applications that are running. Also, make sure that you exit any unnecessary application from the tray icon. If you have a lot of applications/programs running, it may be hard to determine which one is using the file you want to delete. 

Check Resource Monitor

You need to know the application/process that is using the file. however, this is not possible without Resource Monitor. Resource Monitor allows you to know the process that is currently using the file that you want to delete.

Once you figure this out, stop this process/application and delete the file. To find the process that is using the file using Resource monitor,

  1. Press the Windows + R key to open Run.
  2. Type resmon and press Enter.
    Resmon
  3. Click on the CPU tab and expand Associated Handles.
  4. In Search Handles input bar, type in the filename that you want to delete.
  5. Now, you will see any application/process that is currently using the file.
  6. Right-click on this process/application and select End process.
    resource monitor delete files

Once you find the process/application you can close the program using the Task Manager.

Close the program Via Task Manager

Some programs will keep running in the background even when you close the entire application. Since the application still uses the file in the background, you cannot remove this file. To delete these files, you need to kill the background process via the Task Manager.

  1. Press the Ctrl + Shift + Esc to open Task Manager.
  2. Go to the Processes tab.
  3. Select the application that is using the file.
  4. Select End task.
    end process task manager file not deleting
  5. Try deleting the file.

If you cannot find the correct application, close any unnecessary application/process running in the background.

Close the Process using Process Explorer

Sometimes, you may be unable to determine which process is using the file. In this case, we recommend that you use an application developed by Microsoft called Process Explorer. You can use this application to determine the process that is using a specific file.

  1. Download Process Explorer from the official Microsoft website.
    download process explorer
  2. Extract and open the folder.
  3. Run procexp.exe.
    run procext exe file
  4. Press Ctrl + F and type the filename you want to delete.
  5. The application will display any process that is currently using the file.
  6. Once you find the process, right-click on it and select Kill process.
    kill process using process explorer
  7. Try deleting the file from your PC.

Delete from Command Prompt

Running Command Prompt as Administrator gives you admin privileges. This means that you will have access to features that are normally restricted. And you can run commands that are not available in normal user mode.

If the file you want to run is in use by an application that is invoked by normal user, you may be able to delete the file using Command Prompt as administrator. However, if the application is running as admin, you cannot delete this file using this method.

  1. Right-click on the file you want to delete.
  2. Copy the Location.
    copy file location file not deleting
  3. Press the Windows + R key to open Run.
  4. Type cmd and press Ctrl + Shift + Enter to open Command Prompt as Administrator.
  5. Now type del *Location*\*filename* (replace *location* and *filename* with the location you copied from step 2 and the filename, respectively) and press Enter to delete the file.
    delete file using command prompt as admin

Restart the PC and Delete

When you restart the PC, any process that is halting the deletion process stops as well. And if this process/program is not enabled in the startup, deleting this file will work once you restart your PC.

However, if this process starts during boot, you will need to disable the application during startup. To do this,

  1. Press the Ctrl + Shift + Esc to open the Task Manager.
  2. Go to the Startup tab.
  3. Click on any application and select Disable.
    disable startup application delete file open in another application
  4. Disable all the applications that run on startup.
  5. Restart your PC and try deleting the file. 

Restart Windows Explorer

Windows Explorer handles basic desktop functionalities such as icons, the taskbar, the start menu, or processes related to transferring or deleting files. If you have issues related to these components, restart Windows Explorer to fix the issue.

  1. Open the Task Manager.
  2. Select the Process tab
  3. Under Windows Processes, select Windows Explorer.
    end task windows explorer file not deleting
  4. Select Restart.
  5. Now, Try deleting the file.

Delete Temporary Files

Windows creates temporary files to store information when a file is modified or created. After the process is complete, the system may or may not delete these temporary files depending on whether an application uses them. 

If these temp files are currently in use and are linked with the file you want to delete, you may not be able to delete such files. To fix this, first try deleting temporary files.

  1. Press the Windows + R key to open Run.
  2. Type temp and press Enter.
    temp
  3. Select All and permanently delete these files. 
    delete temp files
  4. Press Skip if any of these files are currently in use by another program.
  5. Again, open Run.
  6. Type %temp% and press enter.
  7. Select all the files and delete them permanently.

Turn off Caching of Thumbnails

Windows stores a cache database for thumbnails for your files and documents. Windows uses this database to display a glimpse of the file/folder before you open it. If the thumbnail of the file you are trying to delete is currently in use, the PC may have issues deleting this file.

To fix this, you can try turning off caching of thumbnails from the Group Policy Editor.

  1. Press Windows + R to open Run.
  2. Type gpedit.msc and then press Enter to open Group Policy Editor.
  3. Navigate to User Configuration > Administrative Templates > Windows Component > File Explorer.
    Windows component gpedit
  4. On the right panel, double-click on Turn off the caching of thumbnails in hidden thumb.DB files.
    turn off thumbnail caching
  5. Select Disabled and press Apply.
    disable thumbnail

Change File Explorer Settings

When you launch several File Explorer, the OS runs all its windows in one single process, i.e., explorer.exe. However, if the file explorer runs as two separate processes, the PC might run into conflicts between resources. 

To make sure that this does not happen, you need to launch file explorer as a single process.

  1. Press the Windows + E to open File Explorer.
  2. Click on the three-dotted horizontal icons and select Options.
    file explorer properties
  3. Go to the View tab.
  4. Here make sure that Launch folder windows in a separate process are disabled. 
    launch folder windows in seperate process
  5. Click Apply and then OK.

Delete Files in Safe Mode

You can try deleting the file in Safe Mode if none of the solutions work. In Safe Mode, the system only uses essential drivers and applications to run the Operating system. The OS does not run unnecessary processes, applications, or processes, and therefore you can delete the file in safe mode.

To boot into safe mode,

  1. Press Windows + I key to open Settings.
  2. Go to System > Recovery.
  3. Click on Restart now to boot into the advanced startup menu.
    advanced startup file not deleting
  4. Once the PC restarts, navigate to Troubleshoot > Advanced options > Startup options.
    startup repair file not deleting
  5. Click on Restart.
  6. Again after the restart, press F5 to boot the PC in Safe Mode with Networking.
    safemode with networking file not opening
fix how-to
Deep Shrestha
  • Twitter
  • LinkedIn

Deep Shrestha works as a computer hardware writer at TechNewsToday with several hardware and programming certifications. Although he has been writing technical content for more than a year, his interest in hardware components started at a very young age ever since he heard about PC building. Pursuing his passion, he has assembled several desktop computers. Besides building desktop PCs, Deep also has hands-on experience fixing software and hardware issues on laptops and desktop computers. Using all this knowledge and skills about computer hardware, he's on a quest to make content that's easy to read and understand for everyone. You can contact him at deep@technewstoday.com

Related Posts

how to delete win backup files

How to Delete Backup Files on Windows

January 29, 2023
how to reset password on hp laptop

How to Reset Password on HP Laptop

January 29, 2023
Reset BIOS password

4 Ways to Reset BIOS Password

January 28, 2023
how to make windows 11 look like windows 10

How to Make Windows 11 Look Like Windows 10

January 25, 2023
how to find hidden folder in laptop

How to Find Hidden Folder in Laptop

January 24, 2023
mouse not showing in chrome

Mouse Not Showing in Chrome? Here’s How to Fix It

January 25, 2023
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
how long does a cmos battery last

How Long Does a CMOS Battery Last

January 25, 2023
thunderbolt vs usb c

Thunderbolt Vs USB C: What’s the Difference

January 25, 2023
how to find hidden folder in laptop

How to Find Hidden Folder in Laptop

January 24, 2023
You may also like
how-to-connect-headphones-to-tv

5 Ways to Connect Headphones to TV

January 29, 2023
connect-airpods-to-samsung-tv

How to Connect AirPods to Samsung TV? (Step-by-Step Guide)

January 29, 2023
AIO Pump Not Working

AIO Pump Not Working? Here’s How to Fix It

January 29, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday.

Type above and press Enter to search. Press Esc to cancel.