Completely delete the most stubborn files on Windows

When you can't open, edit, or delete a file in Windows File Explorer, it's either still open in a program running in the background or something isn't closing properly. Luckily, you can force the file to be deleted, closed, or edited with a few simple tricks.

Table of Contents

1. Close the program you opened the file with.

Let's start with the obvious. Did you open a file and not close it? If the file closed but the program is still running, close the application and try again.

Completely delete the most stubborn files on Windows
Windows 10 file in use notification when trying to delete open PDF.

You should also check the system tray to make sure the file isn't just minimized there.

2. End the application via Task Manager

Task Manager can help manually end the process or application holding your file hostage. This is one of the most promising methods to fix the "File is open in another program" error, since you may not always realize that the file is not closing properly.

Press Ctrl + Shift + ESC on your keyboard to open Task Manager . Alternatively, you can press Ctrl + Alt + Del to get to the menu or right-click on the Taskbar and select Task Manager . If you are using Windows 11, right-clicking on the Taskbar will not work.

If you see the compact version of Task Manager, click More details in the lower left corner and make sure you're on the Processes tab .

Browse for the application you used to open the “file in use”. For example, if you were viewing a document, search for Microsoft Word .

Completely delete the most stubborn files on Windows
End tasks in Windows 10 Task Manager.

Once you find the process, select it and click End task in the lower right corner. This will close all instances of the program.

3. Change File Explorer process settings

By default, File Explorer launches all of its windows in a single process (explorer.exe). However, it's possible that your settings force File Explorer to launch separate processes, which can cause conflicts between different processes.

Press Windows key + E to open File Explorer . In Windows 10, go to View > Options > Change folder and search options .

Completely delete the most stubborn files on Windows
Change folder and search options in Windows File Explorer.

In Windows 11, click the See more icon with three dots next to View , then select Options.

Completely delete the most stubborn files on Windows

In the Folder Options window , switch to the View tab and look for the Launch folder windows in a separate process option . Make sure this option is not selected. Click Apply to save any changes.

Completely delete the most stubborn files on Windows
Windows Folder Options Menu

If this option is not selected initially, you should check if this solves your problem.

4. Disable File Explorer Preview Pane

Previews in File Explorer can also cause conflicts, such as the "File is open in another program" error.

In Windows 10, press Windows key + E , switch to the View tab , and press Alt + P to close the preview pane.

In Windows 11, open File Explorer ( Windows key + E ), then go to View > Show and if you see a check mark next to the Preview pane, click it to close the preview.

The screenshot below shows an open preview pane on the right.

Completely delete the most stubborn files on Windows
Close the Windows File Explorer preview pane.

After closing the preview pane, try the operation again and see if the "file in use" error is gone.

5. Force delete file via Command Prompt

You can bypass File Explorer and force delete the file using Command Prompt .

First, we need to track down the file path folder in File Explorer. Press Windows key + E to open File Explorer, locate the affected file, and copy the file path from the address bar at the top of the window.

Completely delete the most stubborn files on Windows
Find file path in Windows File Explorer.

Now, right-click on the Windows Start button and select Command Prompt (Admin) or Windows Terminal (admin) . To navigate to the file folder of the file in use, type cd [the folder path you copied] and press Enter.

Completely delete the most stubborn files on Windows
Navigate to the file path in Windows Command Prompt.

Before we can force-delete files in use, however, we need to temporarily kill the File Explorer process. This will cause your Taskbar, wallpaper, and open folders to disappear. But don’t worry, you can easily restart File Explorer and get everything back later.

  • To close File Explorer, press Ctrl + Shift + ESC to open Task Manager.
  • Find Windows Explorer in the list and right-click the process. Select End task .
  • Return to the Command Prompt window where you entered the previous command.
  • Enter the command below to delete the file, replacing everything between the quotes with the actual file name:
del "file name"

Now, to restart File Manager, all you need to do is open Task Manager ( Ctrl + Shift + ESC ). Then, click File > Run new task , type explorer.exe and click OK. This will restore your desktop to its normal appearance.

6. Unlock the file in use with the tool

If trying to delete the file manually doesn't work or you're not comfortable using the Command Prompt , you can always use Microsoft's Process Explorer.

This is a more powerful version of Task Manager that can show you which processes have taken up your files.

Open Process Explorer's Search window by clicking Find > Find Handle or DLL (or pressing Ctrl + Shift + F ), enter the file name, and wait for a list of processes accessing your file.

Completely delete the most stubborn files on Windows
Process Explorer Search

You can't close a process from the Search window, but you can use Process Explorer or Windows Task Manager to close the offending application. There are also alternatives, such as Unlocker  and LockHunter , that can help you identify pesky processes.

7. Boot into Safe Mode

Sometimes, the file you're trying to delete might be loaded automatically by another app. Apps like Unlocker might still work in that case. However, if there's malware involved or you don't want to deal with third-party tools, booting into Safe Mode  is your next best option.

In Windows 10 or 11, press the Win key on your keyboard and click the power icon. Hold down the Shift key and select the Restart option . Your PC will boot into the Windows Recovery Environment (WinRE) page.

From the next screen, select Troubleshoot > Advanced Options > Startup Settings > Restart . When your computer restarts, you will see the Startup Settings screen. Select Safe Mode and wait for Windows to start.

Completely delete the most stubborn files on Windows
The Windows Recovery Environment page has a Startup Settings option.

While you are in Safe Mode, navigate to the file in question and try to access or delete it.

Now, the next time Windows tells you a file is in use, you’ll know how to free it up or force your PC to delete it. If you’re not comfortable with third-party tools, you can always use the Command Prompt or boot into Safe Mode to help clear up any issues with the file in question.

Good luck!

See more articles below:

Sign up and earn $1000 a day ⋙

Leave a Comment

How to Access Android Storage on Windows 11

How to Access Android Storage on Windows 11

You can directly access your Android phone's storage in Windows 11 File Explorer via Microsoft's new Cross Device Experience Host.

How to enable or disable Secure Sign-In on Windows 10, Windows 11

How to enable or disable Secure Sign-In on Windows 10, Windows 11

Windows is the most targeted operating system by hackers. Therefore, you should strengthen your PC's defenses to stay safe both online and offline. This article will guide you on how to enable or disable Secure Sign-In in Windows 10.

23 Awesome Screensavers to Protect Your Windows Computer Screen

23 Awesome Screensavers to Protect Your Windows Computer Screen

Screensaver - computer screensaver, which is automatically activated when the computer is not used for a certain period of time. Here are 23 beautiful screensavers for Windows.

Windows 11 will make a much-needed change to the Start menu

Windows 11 will make a much-needed change to the Start menu

The latest change being tested solves one of the most annoying things with Windows 11's Start menu, and hopefully it will actually make it to release.

Completely delete the most stubborn files on Windows

Completely delete the most stubborn files on Windows

When you can't open, edit, or delete a file in Windows File Explorer, the file is still open in a program running in the background or something isn't closing properly.

How to Set Up the Perfect Dual Monitor on Windows with FancyZones

How to Set Up the Perfect Dual Monitor on Windows with FancyZones

If you regularly use multiple monitor setups, FancyZones can be a game changer. This Windows PowerToys utility allows you to completely customize your monitor layout.

How to Use Google Authenticator on Windows PC

How to Use Google Authenticator on Windows PC

Google Authenticator can be useful, but it's frustrating that Google hasn't made an official desktop app yet. However, you can use Google Authenticator on your Windows PC through other means. Let's explore how you can use Google Authenticator on your PC.

How to fix network adapter not found error on Windows 10

How to fix network adapter not found error on Windows 10

Many people have encountered the problem of network adapter disappearing from Device Manager or receiving a missing network adapter message. This article will guide you on how to fix the missing network adapter driver problem on Windows 10.

How to hide/unhide the Taskbar on Windows 11

How to hide/unhide the Taskbar on Windows 11

In Windows 11, the taskbar takes up only a small portion of the display space at the bottom of the screen.

Learning from Apple, Microsoft is also about to have Windows Intelligence

Learning from Apple, Microsoft is also about to have Windows Intelligence

Recently, clues that Microsoft will likely "follow the path" of Apple in the field of artificial intelligence have gradually been revealed.

How to create USB Boot using Command Prompt

How to create USB Boot using Command Prompt

Creating a bootable USB to install Windows is becoming more and more popular, there are many software that help create a bootable USB with just a few clicks. But if you are familiar with Command Prompt, you can use this tool to create a bootable USB without installing additional software.

How to Restore WordPad in Windows 11

How to Restore WordPad in Windows 11

Microsoft is killing off its free rich text editor WordPad at the end of 2023 in an effort to transition users to premium Office apps.

How to Take Scrolling, Long Screenshots in Windows

How to Take Scrolling, Long Screenshots in Windows

This guide shows the best tools for taking long, scrolling screenshots in Windows 11 and Windows 10.

How to Set Windows Photo Viewer as Default Photo Viewer on Windows 11

How to Set Windows Photo Viewer as Default Photo Viewer on Windows 11

Windows Photo Viewer was first released alongside Windows XP and has quickly become one of the most frequently used tools on Windows.

Windows 11 is about to add a system configuration advice section

Windows 11 is about to add a system configuration advice section

The latest previews of Windows 11 that Microsoft released this week include an improved About section in the Settings app, where users can get more information about the hardware inside their computer.