When a file is classified as “in use” by Windows, it is typically still open by another process, which could be making changes to it. In many cases, Windows even points you directly to the program in question in the error message, allowing you to simply close it and try again. Typically though, this isn’t the case. If the file is displayed as “in use” but there’s no indication of which app is using it, you have two options to proceed: You can either use the handy tool Unlocker, which integrates itself into the Windows UI seamlessly, or delete or rename files over the command prompt without any third party software.  Here are the methods we’d try – in this order – to delete or rename a locked file.

1. Close Windows Explorer

If you’ve closed down all the obvious apps which could be using the file and you still can’t delete it, it’s probably because Windows Explorer (File Explorer in later versions) is accessing the file, perhaps to display a preview. You could move all other files in the folder to a temporary folder and then delete the folder that contains the immovable file, but if this still doesn’t work, try closing Windows Explorer or File Explorer. If they won’t close, you can force them by using Task Manager (right-click on the taskbar and choose Task Manager).

Now look through the list of running applications for Windows Explorer (File Explorer is still called Windows Explorer here!), right-click on it and choose End Task. You’ll then have to restart it, since Explorer is also responsible for the start menu and the task bar. To do that, click File, Run… and type Explorer.exe and press Enter.

2. Change the file extension

Sometimes this is the simplest way to delete a file that refuses to budge using the Delete key. If you have file called birthday.mp3, select it in Windows Explorer, press F2 and change the extension – the .mp3 – to something else such as .txt. You’ll have to enable file extensions first, though, since Windows defaults to hiding extensions for known file types. To show extensions in Windows 8 onwards, click on the View tab and tick the ‘File name extensions’ box. In previous versions, including Windows 7, search for ‘folder options’ in the Start menu. Click on it and a window will appear. Scroll down and untick the box for “Hide extensions for known file types” and click OK.

3. Use the Command Prompt

Yet another method is to use the Command Prompt. You’ll find this in your Start menu, or Start Screen. Just search for it, click on it and a black window will open. Or, press the Windows key and R to bring up the Run.. box and type cmd.exe and press Enter.

4. Use a third-party deletion tool

Plenty of free utilities can clean up troublesome files, including those that can’t be deleted. They tend to create a script which runs when Windows boots up at a time before any restrictions are placed on the file preventing it being deleted. They include  File Assassin and ECMO UnlockIT (formerly called MoveOnBoot). Also, you can try Long Path Tool which is a favourite for a lot of experienced PC users.

Another method of finding out which program is using particular files is by using the freeware Unlocker. Download the tool and install it. This adds an option in the context menu called “Unlocker” that allows you to get an overview of all the processes that are currently trying to access this file. Choose an operation from the drop-down menu and click on “Unlock all” to close all so-called “Handles” that are blocking access to the file and to apply your operation of choice. A similar free tool, but with a steeper learning curve, is Microsoft’s own Process Explorer. 

5. Boot into Windows Safe Mode

Another option is to restart your PC in safe mode. In Windows 7 or earlier press F8 when the computer is starting up until you see the boot menu. Choose Safe Mode and a cut-down Windows will load. You can try deleting the file in Windows Explorer or File Explorer. Here’s how to boot into safe mode in Windows 10.

Jim has been testing and reviewing products for over 20 years. His main beats include VPN services and antivirus. He also covers smart home tech, mesh Wi-Fi and electric bikes.

How to Delete or Rename a Locked File in Windows - 57How to Delete or Rename a Locked File in Windows - 69How to Delete or Rename a Locked File in Windows - 44How to Delete or Rename a Locked File in Windows - 33