getting access denied when trying to delete files on Windows
Filed In:
Weblog
Posted 03/10/2009 23:45:00
from
MetaAPI
by
Graham
Having spent the day moving several Terrabytes (TB) of data around while doing some management I ran into two really annoying issues.I was getting an error while trying to delete files synchronized from another server by a third party program. As it turns out Windows Server 2003 has a file length restriction, well, it’s actually a file length restriction with NTFS, the file system that Windows Server 2003 uses. File names, including the folder name, must not exceed 255 characters.
The only way around this was to move the files up to the top level of the directory and then delete from there.
Second issue was a related one- I was getting access denied messages while trying to delete a series of folders in explorer even though I had ownership on the files.
I also looked at modifying the permissions in the command line using CACLS files /e /p {USERNAME}:{PERMISSION} in the CLI.
(but having inspected the properties of the files I was the owner so that was not the issue)
Turns out there was a process holding the file open- cidaemon.exe – an indexing service daemon that the windows indexer runs.
Thankfully I found a neat utility called file unlocker – once you install it- there is a shell extension that allows you to right click and choose to view what is going on- (ie what process is holding the file open or what the locking handle is) and then choose a course of action to fix it. Saved me a bunch of time today…