Link to home
Start Free TrialLog in
Avatar of Lieven Embrechts
Lieven EmbrechtsFlag for Belgium

asked on

Access is denied when deleting

I'm getting an 'access is denied' from time to time when trying to delete folders in Windows 2003.
I'm loggied in as admin and i change permissions (full control for everyone in all subfolders too) & ownership for admin (for all subfolders too).
Still access is denied.
Any clues what i am missing here ?
Avatar of NetworkArchitek
NetworkArchitek

Hi Lieven_Embrechts,
Well are files inside these folders open? If they are shared is anyone using them on the network; do you have any programs opening them on the server?

Cheers!
Besides NetworkArchitek good comments, do check that that when taking ownership, this checkbox is ticked.
"Replace owner on subdirectories and objects". This will ensure that any block inheritance setting is overwritten with the new owner set in the change owner to: list.
...;-)
You can research what is occupying that folder or file you are trying to copy by using the following FileMon application by Sysinternals:
http://www.sysinternals.com/ntw2k/source/filemon.shtml

Download this utility to browse what application usng what files...

Good luck

Cyber
Usually this is caused by a proogram running that is accessing the files, try restarting the computer, and if that doesn't work, try rebooting in safe mode (hold F8 during startup, chose safe mode) and then you should be able to delete the files.


Josh
Avatar of Lieven Embrechts

ASKER

There are no open files in those clutter folders.
(files saved in internet explorer)
Imho it's a matter of file naming.
First i get the warning: contains items whose name is too long for the recycle bin.
Delete immediatly ? yes
canot delete news;sec=news;artid:602163;pos=bottom;sz=468x60;tile=2;ord=871047248_files: Acess is denied.
So somehow these kind of long filenames got saved but can't be deleted.
Try renaming the files first :)

Did you try rebooting in safe mode?


Josh
Are you connecting via a share.  Verify the share permission and the security permission are open correctly.
I tried rebooting in safe mode, didn't work.
i didn't like this solution anyway as it would mean that sometimes a reboot in safe mode would be the only way to delete some files, that doesn't sound like a serious server OS.

It has nothing to do with open files, file security, shares.
The folders & files that i cannot delete are moved to a local unshared folder c:\clutter
Cfr detailed error sample in my comment.

IMHO it has to do with (folder or file) name length or characters that got in the filename but not really allowed.
Since it doesn't work in safe mode, you are either trying to delete critcal windows files (probably not ;) ) or it means that its not caused by an access violation.

So your guess on the caracters in the file name might be correct, did you try renaming the file?


Josh
It's solved and it's tricky ;-)
See the directory tree that i attached at the bottom.
As you can see the tree is quite deep and the folders at the bottom of the tree are quite long.
When i move the folder 'IN' directly under 'restore', so i move it a number of tree-branches higher, suddenly i can delete the folders.
So if the tree depth is quite high and/or the folder names quite long, it's impossible to delete the bottom folders.
When i decrease the tree depth or move the long folder names higher, it becomes possible again to delete.
It has to be some Win2003 limit i'm bumping into ...
Anyone knows which one ?


C:\clutter>tree

C:.
└───restore
    └───Backup Set L
        └───Documents and Settings
            └───lieven
                └───Desktop
                    └───test
                        └───Information
                            └───IN
                                ├───ATM and Alternatives in the Wide Area Backbo
ne   (Network Magazine Article)
                                │   ├───ATM and Alternatives in the Wide Area Ba
ckbone (1)    (Network Magazine Article)_files
                                │   ├───ATM and Alternatives in the Wide Area Ba
ckbone (2)    (Network Magazine Article)_files
                                │   ├───ATM and Alternatives in the Wide Area Ba
ckbone (3)    (Network Magazine Article)_files
                                │   ├───ATM and Alternatives in the Wide Area Ba
ckbone (4)    (Network Magazine Article)_files
                                │   ├───ATM and Alternatives in the Wide Area Ba
ckbone (5)    (Network Magazine Article)_files
                                │   ├───ATM and Alternatives in the Wide Area Ba
ckbone (6)    (Network Magazine Article)_files
                                │   └───ATM and Alternatives in the Wide Area Ba
ckbone (7)    (Network Magazine Article)_files
                                ├───Lucent and TeraBeam to launch fibreless netw
ork   (from vnunet.com)_files
                                │   └───news;sec=news;artid=602163;pos=bottom;sz
=468x60;tile=2;ord=871047248_files
                                ├───Protocol helps stretch IPv4 addresses (RSIP)
    (by Network World)_files
                                │   └───0117tech_files
                                │       └───techprimers;top=;pos=right;sz=120x24
0;tile=2;ord=102401_files
                                ├───VoIP to carry 'bandwidth tax'    (Network Wo
rld News Article)_files
                                │   └───1030voip_files
                                │       └───dailynews;top=;pos=right;sz=120x240;
tile=2;ord=115903_files
                                └───Wonderful World of Linux 2.4 (Final Draft)
  (on Linux Today)_files
                                    └───site=internetcom&PagePos=10&size=125x125
&channel=linux&content_site=www.linuxtoday_files

C:\clutter>
Sorry, my tree uses extended characters which translate pretty unreadable on the web.
I should've used the asci option in the tree command to make it more readable...
Even renaming doesn't work an long folder names in a deep directory tree.
Access denied !
Sigh. Dumb windows server OS ?
You might be trying to delete something that's in use, you might want to try and boot up in Safe Mode so that nothing is running.  YOu shouldn't have any problems there.
It's the filename limitation issue i guess. NTFS supports file names with a maximum of 255 characters.
>It's the filename limitation issue i guess. NTFS supports file names with a maximum of 255 characters.

Including the complete tree structure then ?
I can delete the long named directory when in a small directory structure,
i can't delete when in a deeper directory structure.
Where are the experts to explain ?
If you want a more than 255 Chars long support, you will have to use another software to manage your files and folders (and there are a few out there...)

Cyber
I am not sure if the 255 chars limit is including the tree structure, but I do know that the tree structure can't be but so long.. so it just might be :)

Josh
fyi: sum of the length of all folders (including the last long one) is 140 to 150 characters.
> If you want a more than 255 Chars long support, you will have to use another
> software to manage your files and folders (and there are a few out there...)

examples ?
You had me hooked. I've tried looking for an NTFS specification but the nearest that I got was this for 95:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q148754

which basically says that the limit is 259 characters for the path counting from a point. I would love if someone finds a spec for NTFS regarding this.
OK
Try to use Knoppix to manage your drive in terms for file and directory management. Access them and rename them to a proper accessable formats.

Links:
Knoppix:
http://www.knoppix.net

NTFS management using Knoppix:
http://linux-ntfs.sourceforge.net/man/ntfsprogs.html

Copying files using Knoppix:
http://linux-ntfs.sourceforge.net/man/libntfs-gnomevfs.html

Hope that helpes...

Cyber
I'm not interested in Knoppix.
Would love to find someone who can tell me why i can't remove a long folder in a directory tree 8 deep and i can delete the folder in a smaller directory tree.
Hmmm...
try to run chkdsk within recovery console, let Windows 'fix' the name to be suitable... This should allow you get in to the folder after new startup...

Cyber
Try opening a command prompt and using the del command:

C:\> del c:\clutter

It'll ask you of you're sure, and should remove all file in the directory. Warning though, this is permanent, there is no recycle option here.

DS
no, chkdsk and del-command don't work...
ASKER CERTIFIED SOLUTION
Avatar of Cyber-Dude
Cyber-Dude

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
correct, the syntax 'RD \\.\drive letter:\path\directory name' bypasses internal checks on special characters, length & reserved names
and makes it possible to solve this problem quite easely.

You might want to defrag your hard disk and reboot.  I had a few files that wouldn't delete, but after defragmenting and cleaning up my recycle bin I was able to delete them normally.
i don't get the my answer
I had a similar problem about a week ago where I would take ownership and had full permissions.  I found that some of the files still had the improper ownership.  Check the permissions and owernship on some of the files that are nested in some of sub directories.
I've had some luck using the DELTREE.EXE from a Windows 95 system to delete 'undeletable' directories on 2000, and XP pro. It's permanent though.
Also if it's a length problem, you might be able to "susbt" to a level down from the root and delete from the new drive letter.