Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regulary can't delete folders

Status
Not open for further replies.

mattstan

Programmer
Aug 2, 2007
14
GB
Hi,

Win XP Pro SP2 (fully up to date).

I regulary can't delete folders (even empty ones) using Explorer, I get the error:

'Can't delete FOLDER_NAME it is being used by another person or process. Close any programs that might be using the file and try again'.

This happens with a wide veriety of folders and, after a while (5 mins, 15 mins, 2 hours, it varies) or a reboot, I can delete the folder as normal. Now I would expect this to happen when a file in the folder, or in a sub-folder of it, is open and in use by some software - but it's not, and I have checked in 'task manager' to make sure that any software's process is ended (because if the process has stayed alive this would explain my problem, but it hasn't). Also no other person can use this PC, so no one's connected remotely and so can't be using any files on a shared drive (no drives are even shared at all).

To further confuse me - I am able to delete all the files in the folders which I can't delete, but then not able to delete the now empty folders themselves (my Explorer settings show all hidden and system files so I'm sure the folders are empty). The error message says 'Close any programs that might be using the *file*...' but all the files have been sucessfully deleted it's just the folders I can't delete !!

In desperation I've also tried using another file manager, a downloaded piece of freeware, and that too fails to delete the folder.

How can I sort this out? It is very annoying and happens regulary.

Many thanks, regards, etc..

PS. AV = AVG Free, FW = Comodo Firewall Pro.
 
I suspect the folders in question may be being kept in use by Explorer itself.

Try installing the invaluable 'Unlocker' from I use it all the time for this very same reason.

Hope this helps...
 
Thanks Rick998 for suggesting unlocker.

I installed it and ran a test it works well but there is a problem.

Multiple 'unlocker.exe' instances stay alive!

I right-click on the folder, hit unlocker, the unlocker dialog pops up, I hit unlock all, the dialog closes, and I can delete the folder. The problem is that each time I do this unlocker.exe stays alive. I've run 4 tests and have 2 instances (at one time 4 instances) of unlocker.exe processes still shown in Task Manager, each taking up 4 MB RAM. Why is this? Can't I get unlocker to die after clicking unlock all? Or how do I quit it / stop the processes without manually doing end process in task manager?

BTW I turned off its 'assistant'.

Many Thanks.
 
PS. a few mins later down to 1 instance of unlocker.exe in task manager, having not used to again, nor killed a process, or fiddled with it in any way!
 
PPS. now all unlocker.exe processes gone. Why do they stay alive so long?
 
Mattstan,

I've just checked and I only have 1 instance of Unlocker active when I invoke it.

I suspect that the reason you have additional instances of Unlocker that are slow to kill is because Unlocker is checking for an update. This isn't necessary as 'Nitch' rarely updates Unlocker.

Try un-installing Unlocker then re-installing it with only 'Explorer extension' ticked, nothing else.

As a matter of interest, did Unlocker tell you what process was keeping you from deleting folders? Was it Explorer?

 
No - I didn't install the check for updates at all.

"As a matter of interest, did Unlocker tell you what process was keeping you from deleting folders? Was it Explorer?"

Yes.

Thanks.
 
If Explorer is slow to release its grip on folders and Unlocker is slow to close its own process(es) after forcing a release then this suggests something else may going on in the background.

Are you using an anti-virus product with 'on access' scanning that may be slowing things up? What does Task Manager show for CPU usage before and during Unlocker doing its unlocking?

For example, I have several apps running (including NOD32 anti-virus, Firefox, a couple of open Explorer windows, Copernic Desktop Search and VNC) with a total of 30 processes running, using 0-1% CPU usage.

When I invoke Unlocker to remove Explorer's hold on 4 folders the CPU usage rises to 13% for approx. half a second then returns to 1%. When I delete the 4 folders CPU usage rises to 9% for approx. half a second then drops back down again.

 
did u use a registry tweak tool?

go to HKLM/current user/control panel/desktop and change key autoendtasks to 1, also check
WaitToKillAppTimeout, set it to 20000 or lower and
HungAppTimeout to 5000 or lower
 
Lemon13,

Sorry but... your advice is incorrect.

There is no 'HKLM/current user/control panel/desktop' path or subkey in the Win XP registry. There's an HKLM hive (i.e. system-wide settings) and an HKCU hive (i.e. per-user settings) but not a mixture of both.

The settings you suggest for 'AutoEndTasks' relate to log off or shutdown, not the slow closing of/release of processes during normal usage.

The settings for 'WaitToKillServiceTimeout' relate to shutdown, not the slow closing of/release of processes during normal usage.

The settings for 'HungAppTimeout' relate to how long the system waits for user processes to end after the user clicks the 'End Task' button in 'Task Manager', not the slow closing of/release of processes during normal usage.

 
And just for the heck of it, I would run CHKDSK c: on your hard drive. Checks for errors. It if finds any, re-run CHKDSk c: and add the /R switch. Press Y when asked if you want to run this at the next boot. Then reboot and wait until CHKDSK completes.

I would also think about doing a defrag.

Also, check the event viewer for possible errors or indicators as to what is locking your folders.
 
I used to use Bitdefinder AV and I could not delete some folders on less I turned off Bitdefinder then I could delete. The AV dose a scan of the folder before deleting and if it take to long the delete process times out. A on demand spyware program could also cause problems.
 
Thanks for the advise guys. I'll run checks later to see if my AV is causing problems. Sorry to be brief, major work load landed on my desk this morning & am swamped.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top