Question

Is there a way to unlock Windows files without downloading a utility?

I have a few files on my Windows XP C: drive that are very old and very useless. When I try to delete these files I get the following message:

Cannot delete FILENAME.zip: It is being used by another person or program

Close any programs that might be using the file and try again.

No one is accessing this file. No program is using it currently. Windows has screwed up the file locking mechanism.

Is there a way to delete this file without downloading someone's unlocking utility? I find the sites offering these programs to be a tad sketchy.

How could you force the file to unlock from within a program? I'm competent in Java, Perl, and Ruby, but I haven't seen anything among their libraries that would aid me here.

Was it helpful?

Solution

I've successfully used Process Explorer to find out which process has the file open. It saves a reboot that may not fix the problem anyway.

OTHER TIPS

Try downloading "Unlocker". Google it and take my words that it doesn't have any worm/spyware/virus. It is pretty cool utility and works great. Give it a try.

Did you try the commandline command OpenFiles

It is built in (XP and above I believe) and has several arguments that can be passed in.

Use msconfig and start up with everything turned off.

Then try to move / delete the file.

Or you can always boot up in safe mode and delete it.

You do that by hitting f8 when the machine boots up.

If you reboot and the files are still locked, then there is some process on your machine that is still using them. First you should figure out what that process is and determine if the files really aren't used any more or not.

Rebooting to Safe Mode is often a very easy way to do it. When you boot in safe mode, it won't load all the stuff set to run on startup. Press F8 while it's booting to access the boot menu, and choose "safe mode".

I had a .jpg pfile that hasd that issue and I couldn't delete. That brought me to this thread. When nothing else worked I renamed the file and left off the .jpg. THEN I could delete it easily. Not sure why, but worked for me

You don't need any utility. Just use Win32 api to unlock them (simply close the handle)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top