Tip:
Highlight text to annotate it
X
Have you ever tried to access or delete a file, only to get one of the following messages?
“Cannot delete file: Access is denied” “There has been a sharing violation.”
“The source or destination file may be in use.” “The file is in use by another program
or user.” “Make sure the disk is not full or write-protected and that the file is not
currently in use.” “The action can’t be completed because the file is open”.
Out of the many options available to view what program has a file open and locked I
prefer to use the program “Unlocker”. Unlocker is used to kill processes that are
locking a particular file so they can be safely moved or deleted. Let’s download and install
Unlocker. Open a web browser like Internet Explorer. In the address bar enter “emptyloop.com/unlocker”,
and press enter. On the Unlocker Home Page, click the “Download” link. Under downloads it
has links for both the 32 bit and the 64 bit versions. If you are unsure of which version
of Windows you have, I will place a link on screen to another tutorial covering how to
check which version you have. I have a 64 bit version of Windows 7 so I will download
that version by clicking the link. On the “Download Information” bar, click the
“Run” button. This will download the file and then automatically start the installer.
On the “Installer Language” window, click the “OK” button. The “Unlocker Setup”
window will open on the welcome screen. Click the “Next” button. On the “License Agreement”
screen, read the license agreement, and then click the “I Agree” button. On the “Choose
Install Location” screen, click the “Next” button. On the “Choose Components” screen,
deselect “Bing bar”, and click the “Install” button. When the brief download finishes click
the “Finish” button. I created a test Office document to use for testing. I will
open the document in OpenOffice. Now if we look in the folder where the document resides,
we now see this “lock” file for the “OpenFileTest.doc” file. This is showing because I have this
folder set to show hidden files. I will try to delete this file, by right-clicking and
selecting “Delete”. On the confirmation window click the “Yes” button. The “File
In Use” window will open stating that the file cannot be deleted because it is open.
Let’s see what program has the file open and locked. Right-click on the file and we
can now see there is an “Unlocker” item in the list, select it. The “Unlocker”
application window will open. It will list the process or processes that have the file
locked. “Process”. This is the name of the process that has the file in use. In this
case it is “soffice.bin”, which is the OpenOffice word processing program. If you
are unsure what program a particular process is from, a quick google search should help
you out. “Path Locked”. This is the path to the file you are checking for locks. In
this case the file in on the “C:” drive on my computer, in the “Temp” folder,
and is named “OpenFileText.Doc”. “PID”. This is the process identifier number. “Handle”.
This is the handle number of the PID locking the file. “Process Path”. This is the
path to the process that is locking the file. In this case the “soffice.bin” files full
path is c:\program files (x86)\OpenOffice.org 3\program\soffice.bin”. With this information
It would be best to close this file in OpenOffice, and then delete, or move the file. There are
times when it might hang, or some other reason, where you can’t close the program to free
up the file. You have two options on how to proceed. With either option you need to click
on the item in the list to select it so it is highlighted blue. Option One. You can click
the “Unlock” button. “Unlock” will free up the file lock allowing you to delete
or move the file, while still keeping the program with the lock up and running. I will
click the “Unlock” button. I can now delete the file. The file is still open in OpenOffice
and I can save it again. Option Two. You can click the “Kill Process” button. This
will close down the program that is locking the file. In this case it will close out the
OpenOffice program. I will click the “Kill Process” button. We can see that the OpenOffice
application has closed down. This is because Unlocker killed the PID from OpenOffice that
was locking the file. We can now successfully delete the file. In some cases it may leave
behind lock files that need to be cleaned up manually after. The “Unlocker” option
will remain in your right-click menu, so it can be used as needed in the future. I hope
that this helps cleanup some of those annoying file locks for you.