How to delete or rename files and folders that are in use or locked in Windows

  • November 19, 2006
  • 10:59 PM
  • Read 123,295 times

Table of Contents

  1. Introduction
  2. 4 Steps to working with in use or open files
  3. Using Unlocker to work with in use files
  4. Conclusion

Watch the video companion to the tutorial here!


One of the more frustrating experiences when using a computer is when you want to delete or rename a file or folder in Windows, but get an error stating that it is open, shared, in use, or locked by a program currently using it.

Error deleting file or folder
Error Deleting File or Folder

You start to shut down every program running on the computer hoping that you will be lucky and be able to delete the file, but it still won't delete. What do you do? This tutorial is designed to answer these questions and provide methods that will allow you to delete or remove practically any file in Windows.

4 Steps to working with in use or open files

When attempting to delete or rename a file or folder you should follow these steps in the following order:

  1. The first, and easiest method, is to shut down any programs that may be currently using that file. When a program is using a file it tends to exclusively lock that file so it can't be modified or renamed while it's in use. By shutting down the program using it, you unlock that file or folder so that you can work with it.
  2. Reboot your computer. When you reboot your computer, this will shut down any open programs and hopefully on reboot allow you to work with the file in question.
  3. Reboot into safe mode and try to rename or delete the folder. When you are in safe mode a limited number of programs start up automatically. This provides a greater chance or being able to rename or delete a stubborn file or folder.
  4. Last but not least, download a file unlocking utility. File unlocking programs will find the processes that are using the file and attempt to close them or disconnect their connection to the file or folder so they can be deleted, renamed, or otherwise manipulated. These programs tend to do the work for you so you do not have to deal with the headache of finding the program that is keeping a file open. In the next section we explain how to use one such program, called Unlocker.

Using Unlocker to work with in use and open files

If you are still reading this, then you must be at step 4 above. To help solve this problem, we introduce a program called Unlocker. Unlocker is a program that kicks in when Windows can't delete or rename a file and provides a series of options for enabling you to do so.

The first step is to download the Unlocker program. This program can be downloaded from the following link:

Unlocker Download Link

Once the program is downloaded, save it to your desktop and double-click on the file to start the setup program. When the installation program starts, keep pressing the Next button until you get to the Choose Components page as shown in the figure below.

Unlocker Choose Compents in Setup
Unlocker Choose Components in Setup

Make sure there is a checkmark next to each component, as shown above, and then press the Install button. Unlocker will install and when it is completed you should click on the Finish button.

Now that the program has been installed, Unlocker will have added a autorun statement to your registry to start the Unlocker Assistant when Windows starts. This background program stays resident and detects when you try to delete, copy, rename, or move a file that is in use. When it detects one of these operations, it automatically open up a Window in order to assist you in working with the file. An example is shown below.

In our example, we are trying to delete a file called E:\Test\Readme.doc. When we try to delete the file Windows tells us the file is being user by another person or program and that it cannot delete it. It also suggests we close any programs that might be using the file and try again. Well since we already tried the previous steps, we know this won't work and press OK.

Error deleting file or folder
Error Deleting File or Folder

With Unlocker installed, when you press the OK button to exit the error, Unlocker Assistant will automatically launch to help you delete the file. An example of this is shown in the image below.

Unlocker Assistant
Unlocker Assistant

This shows that two processes have open file handles to E:\Test\Readme.doc and they are C:\Windows\System32\cmd.exe and C:\Windows\System32\ Since we want to delete the files, we change the pull down menu from No action to Delete and then click on the Unlock All button. What this does is delete the open file handles that the two programs have open to the Readme.doc file and then attempts to delete the file.

If Unlocker still has problems deleting the file after closing its file handles, it will ask you if you want to delete the file on reboot as shown below.

Delete the file on reboot
Delete the file on reboot

If you specify Yes, then Unlocker will add a setting in Windows to delete the file on the next reboot. For the most part, this last method should be able to delete most files.

If you choose not to let the Unlocker Assistant start when Windows starts, then you can always just right click on a file and folder and select Unlocker to get into the Unlocker Assistant as described above.


With this information you now know that living with stubborn files is not your only answer. Before, working with a truly stubborn file was the province of a more experienced computer user, but not anymore. Now with programs like Unlocker, even a casual or beginning computer user can take back control of their computer and its files.

Users who read this also read:

  • How to determine what services are running under  a SVCHOST.EXE process Image
    How to determine what services are running under a SVCHOST.EXE process

    A very common question we see here at Bleeping Computer involves people concerned that there are too many SVCHOST.EXE processes running on their computer. The confusion typically stems from a lack of knowledge about SVCHOST.EXE, its purpose, and Windows services in general. This tutorial will clear up this confusion and provide information as to what these processes are and how to find out more ...

  • How to Shrink and Extend NTFS Volumes in Windows Image
    How to Shrink and Extend NTFS Volumes in Windows

    In the past when you needed to resize a partition in Windows you had to use a 3rd party utility such as Partition Magic, Disk Director, or open source utilities such as Gparted and Ranish Partition Manager. These 3rd party programs, though, are no longer needed when using Windows as it has partition, or volume, resizing functionality built directly into the Windows Disk Management utility.

  • How to find the command line arguments a program started with in Windows Image
    How to find the command line arguments a program started with in Windows

    Some programs provide the ability to add arguments when executing it in order to change a particular behavior or modify how the program operates. As an example lets look at the command line argument for Firefox called safe-mode. If you start Firefox with the command line firefox.exe -safe-mode Firefox will start without any extensions or themes. As you can see adding a command line argument to the ...

  • How to Manually Remove Programs from the Add Remove Programs List Image
    How to Manually Remove Programs from the Add Remove Programs List

    Let's admit it, we have all at one time or another mistakenly deleted a directory or uninstalled a program incorrectly and are now left with entries in the Add/Remove Programs list for programs that no longer exist on our hard drives. When you click on these entries to remove them, Windows complains with an error or nothing happens. For some of the neat freaks out there, this can cause a ...

  • Windows Forensics: Have I been Hacked? Image
    Windows Forensics: Have I been Hacked?

    One of the top questions I see on forums is "How do I know if I have been hacked?". When something strange occurs on a computer such as programs shutting down on their own, your mouse moving by itself, or your CD constantly opening and closing on its own, the first thing that people think is that they have been hacked. In the vast majority of cases there is a non-malicious explanation ...



blog comments powered by Disqus
search tutorials


Remember Me
Sign in anonymously