The "The folder is not empty" bug on file deletion in Windows Expl

G

Guest

How can I come around the problem of Windows Explorer when you are trying to
delete many folders and suddenly get the error "Cannot remove folder
myfolder: The directory is not empty."? This error is quite annoying when you
have many files to delete. When will the issue be fixed?
 
P

Pegasus

Joachim said:
How can I come around the problem of Windows Explorer when you are trying
to
delete many folders and suddenly get the error "Cannot remove folder
myfolder: The directory is not empty."? This error is quite annoying when
you
have many files to delete. When will the issue be fixed?

This is not a bug as you suggest but is so by design.
The problem folder most likely contains a file that is
either locked or for which you have insufficient
access rights. Unlock it or fix up the permissions and
you won't have a problem!
 
G

Guest

The problem folder most likely contains a file that is
either locked or for which you have insufficient
access rights. Unlock it or fix up the permissions and
you won't have a problem!

No, that is actually not the case. The permissions are all there. When
deletion has failed and I retry to delete, it works. The annoying thing is to
have to supervise a deletion process.
 
P

Pegasus

Debugging a process that is invoked via a GUI is difficult
by remote control because I cannot see what you do and
because error messages are difficult to trap. If you really
want to get to the bottom of this problem then you need to
work in a tightly controlled environment. The following
commands work in such an environment and they trap all messages.

- Click Start / Run / cmd {OK}
- Type these commands:
cd /d "d:\My Documents\Some Folder" {Enter}
rd /s "NameOfFolder to be deleted" 1>c:\report.txt 2>&1
dir /s /ah "NameOfFolder to be deleted" >> c:\report.txt
notepad c:\report.txt

If you can capture an instance of a folder not getting
deleted on the first attempt then the file c:\report.txt
may contain useful information that can be used for
further debugging.

You should also consider the possibility that some file
may be locked on your first deletion attempt and is unlocked
on the second attempt, perhaps because the program
locking it has now closed down.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top