Technology in terms you understand. Sign up for the Confident Computing newsletter for weekly solutions to make your life easier. Click here and get The Ask Leo! Guide to Staying Safe on the Internet — FREE Edition as my thank you for subscribing!

Why do my files get locked?


How come my files (not locked files to run the computer) get locked and
how to scan them or delete them?

Files can get locked for many reasons; the most common being that some other
program simply has the file open for some reason.

In this video excerpt from a recent Ask Leo! webinar,
I’ll discuss some of the ramifications of locked files, how to tell who’s doing
the locking, and what steps are appropriate to deal with it.

Become a Patron of Ask Leo! and go ad-free!

View in HD (1280×720)


How come my files (not locked files to run the computer) get
locked and how to scan them or delete them?

It depends on how you’re determining how they are locked. The scenario that
I actually have an article on is this concept of a file being in use.

When one application has a file open, depending on how that application has
opened the file, it can actually cause the file to be locked. It can be locked
in several different ways, but the most basic way is that the file cannot be
deleted until that program actually lets go of it.

In this particular case, you can see that I bring up…we’ve got MoveOnBoot
here; there’s another article I believe that will show you who’s using it and
let’s see, ‘Who can I see is using the file?’ Yea, that’s the one I was looking

This uses Process Explorer (or procexp) and you can use a ‘Find’ on Process
Explorer on the filename you are having trouble deleting and it will show you
all of the applications that are using it. So in this example on the screen
here, I took a look at the time for personal.pst which at the time was my email
folder that I was using with Outlook. And for just searching for personal.pst in
procexp, it showed me that Outlook.exe was the program file open and that I
could close Outlook.exe and of course, the file was no longer being reference by
anybody and I could do whatever I wanted to it.

I believe my assistant Mark has a favorite utility that he keeps pointing at
and if he types it in here real quick before I’m done with the question, I’ll
mention it. Basically, there are several different applications that will
attempt to identify who’s got a file open and in some cases, are able to unlock
the file forcefully. Unlocker Assistant is the name of the tool.

They’re able to unlock the file forcibly from underneath the program that
happens to have it open so that the file can then be deleted or closed. It may
very well confuse that program that thought it had it open, but in most cases,
if you’ve come to this kind of situation, that’s not necessarily a bad place to
be because clearly you’re running in to some kind of a problem.

But in general, programs that have files open, the important thing to
understand is what program is it that has the file open; is it a program you
recognize? Should it be using that file? If it is, you probably want to leave it
alone. If it’s not, then you probably want to take some additional and more
forceful steps.

And when you say, ‘…how to scan them or delete them,’ I’m not necessarily sure what
you mean by scan. If you’re concerned about your anti-virus program not being
able to scan it, I would probably suggest you look into another anti-virus
program because as it turns out, there are…most anti-virus programs out there
now make use of the same facilities as the backup software uses that allows
them to at least read the contents of a file while it’s being used. It says
‘volume shadow copy’; I think it is.

So that file, even though it might be in use, can be backed up and that same
technology can be used by the anti-virus tool to at least scan the contents of
the files and understand whether or not there are viruses inside them.

Do this

Subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.

I'll see you there!

5 comments on “Why do my files get locked?”

  1. Leo, in the last two paragraphs of the above article, you talk about the ability of an anti-virus software to scan a “locked” file. If, instead, the files were encrypted, would an anti-virus software still be able to scan them effectively or at all? Or should/must the user decrypt the files first? Thanks…

    It depends on the type of encryption used. If a tool like TrueCrypt, AxCrypt, or even zip file encryption is used then no, tne anti-malware tools can’t peek inside. If you’re using Windows file system encryption then they *may* be able to be viewed – logging in as you may make them visible. (I’m not sure as Windows filesystem encryption is something that I avoid.)

  2. More than one times I got files that cannot be deleted, moved or renamed. The only way that I found to delete them, is to delete them in Safety Mode.

  3. I am running Windows XP. I have had a problem with mp4 and quicktime files becoming locked even when they haven’t been opened by a player. I use Unlocker but if you are renaming many files it becomes a long process to unlock each one. After research on the web I found my major problem to be Windows Live Picture Gallery. After uninstalling and removing it’s traces from the registry I very rarely experience these files locking anymore.

  4. Is there a way to “unlock” all of the files (except system files). In WIN 7 Ultimate I still encounter “you do not have permission to see these files” Why not? It is my computer! It could even be the pictures folder or a file on one of my networked PC’s. (all with Win7)


Leave a reply:

Before commenting please:

  • Read the article.
  • Comment on the article.
  • No personal information.
  • No spam.

Comments violating those rules will be removed. Comments that don't add value will be removed, including off-topic or content-free comments, or comments that look even a little bit like spam. All comments containing links and certain keywords will be moderated before publication.

I want comments to be valuable for everyone, including those who come later and take the time to read.