I was trying to delete some archived files from our file server today but kept running into a “Can not delete this file” error. It didn’t give me any more details than that when I tried to delete the archived files.

I tried to change the permissions and change the ownership on the files so that I could delete them, but I still didn’t have any luck actually deleting the files.

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. Because some of our files exceeded 255 characters I was unable to delete the files, although I could manipulate it in other ways.

I solved my problem by moving the deep folders to the root of the hard drive and then deleting them. That worked without fail and I was able to delete all the files that had previously given me the “Can not delete this file” error.

Technorati Tags: , , ,

One Reply to “File Name Length Restrictions – Can’t Delete Files”

  1. Outda–standing. Had EEs use long file names deep in subdirectories. Had just spent about 4 hours trying to do a work-around. The files would just not erase.
    U R a genius! Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.