Helping people with computers... one answer at a time.

Files can get locked for several reasons, but the most common by far is simply that some other program is currently accessing them.

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.

Mn0Ha -RCȪbCx NlSz:jӼ7Τ>[Vؚ3(!*XzJ-ܲ} -aoDq@%trg View in HD (1280x720)


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 for.

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, ' 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.

Article C5213 - April 15, 2012 « »

Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

April 16, 2012 8:38 AM

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.)
April 17, 2012 9:49 AM

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.

Don Koenig
April 17, 2012 11:18 AM

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.

April 17, 2012 12:01 PM

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)

Mark J
April 17, 2012 12:15 PM

Sometimes Windows can get overly aggressive in protecting files from being changed. This article explains how to change the permissions for files.
How do I gain access to files that Windows says I don't have permission to access?

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to to ask your question.