Page 1 of 1

path/filename too long

Posted: 06 Mar 2016, 21:15
by TJBaker57
Hello and thanks for the Testdisk software!

I am currently copying files from an exfat drive that lost power during file write operations. I am copying by manually listing and selecting files for copy. Occasionally I errantly select a directory that contains trashed fat data and I end up with a raft of files and directories that cannot be deleted. Windows mostly reports the file cannot be found. Other software reports the path, filename or both are too long. (Makes me wonder how those files get created!)

How does one get rid of these?

TJ Baker

Re: path/filename too long

Posted: 07 Mar 2016, 19:18
by cgrenier
Try "cmd", use "dir", "cd directory_name" and "del /r dir_name" to delete them.

Re: path/filename too long

Posted: 07 Mar 2016, 20:07
by TJBaker57
Thanks for the suggestion. I had tried all manner of approaches and any attempt to rename, delete, or whatever failed from both command line and windows explorer.

Eventually I came upon a web post that recommended robocopy since that uses a different method of addressing files where the name length is not an issue. In short, using robocopys ability to mirror a directory to a target allows one to mirror an empty directory to the directory containing the file(s) you need to be rid of. Just be certain to copy out any other files in there you need before you do this.

Mkdir empty_dir
Robocopy empty_dir directory_with_long_filenames /s /mir
Rd empty_dir

This quickly blew away everything that had refused to be deleted by any other means.