Discussion Locked

Cannot delete a file, name too long

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I need to delete some files off of a Windows 2000 server The file names are "filename_archive.csv.dupe.csv.dupe" over and over, probably over 200 characters long. I am unable to delete, move or rename the files. When I attempt to I receive the following error "Cannot delete (move, rename) file: The filename you specified is invalid or too long. Specify a different filename." Any suggestions???

10 replies

by ann777

You have to put the exact filename in quotes...
then it should delete.

Or you should be able to boot to Recovery Console, navigate to the specific folder and then del filename_archive*.*

by huckleberryhound

Open a command prompt window and navigate to this directory. Do a DIR /X command to see the short 8.3 file name and then try deleting the short name.

You might also try using doing something like this
del filename_archive.*

Another idea wouldbe to drag and drop the files you want to delete into another folder and then delete the folder.

by toreador

I was unable to move, rename or delete the files. However, I was able to delete the files using the short name from a command prompt. Thanks!

by d.walker5

If the above solutions fail, Try using a Windows 2000 Resource Kit tool, Subinacl.exe, to take ownership of the item.

To use Subinacl.exe, you first need to determine the item's short filename, which you can do by executing this command in the item's parent folder:

dir /x

Armed with the short name, use the Subinacl.exe command to take ownership and grant full access:

subinacl.exe /file \ /setowner=administrator
/grant=administrator=f

If you need to take ownership of an entire directory tree, use the /subdirectories switch with the command, as shown in this example:

subinacl.exe /subdirectories /setowner=administrator /grant=administrator=f

In some cases, you might need to use multiple Subinacl.exe commands to take ownership and gain access to a lengthy subdirectory tree.

After you take ownership and grant full access to the reserved folder or file, you should be able to remove it using Rm.exe.

This answer was copied from a TechRepublic article titled "Delete folders with blank or reserved names" published on 2/28/2003.

by jose_12650

If you can boot your machine to DOS, remove the file/directory through the del or deltree command.
Or you can go to http://www.datapol.de and download a free trial english version of CIAcommander. Boot your server from this floppy disk and goto File Managager, access your file from my documents and settings and delete the file.

This discussion is closed to new replies.