General discussion

Locked

Cannot delete a file, name too long

By toreador ·
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???

This conversation is currently closed to new comments.

10 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Cannot delete a file, name too long

by Ann777 In reply to Cannot delete a file, nam ...

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*.*

Collapse -

Cannot delete a file, name too long

by toreador In reply to Cannot delete a file, nam ...

Thanks for the suggestions

Collapse -

Cannot delete a file, name too long

by HuckleberryHound In reply to Cannot delete a file, nam ...

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.

Collapse -

Cannot delete a file, name too long

by toreador In reply to Cannot delete a file, nam ...

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!

Collapse -

Cannot delete a file, name too long

by d.walker5 In reply to Cannot delete a file, nam ...

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 <path>\<shortname> /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 <path> /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.

Collapse -

Cannot delete a file, name too long

by toreador In reply to Cannot delete a file, nam ...

Poster rated this answer

Collapse -

Cannot delete a file, name too long

by jose_12650 In reply to Cannot delete a file, nam ...

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.

Collapse -

Cannot delete a file, name too long

by toreador In reply to Cannot delete a file, nam ...

Poster rated this answer

Collapse -

Cannot delete a file, name too long

by toreador In reply to Cannot delete a file, nam ...

This question was closed by the author

Collapse -

Path too long?

by BarryFlows In reply to Cannot delete a file, nam ...

you can use long path tool it will help you

Back to Windows Forum
10 total posts (Page 1 of 1)  

Related Discussions

Related Forums