path/filename too long Topic is solved

Using PhotoRec to recover lost data
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
TJBaker57
Posts: 2
Joined: 06 Mar 2016, 21:07

path/filename too long

#1 Post 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

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: path/filename too long

#2 Post by cgrenier »

Try "cmd", use "dir", "cd directory_name" and "del /r dir_name" to delete them.

TJBaker57
Posts: 2
Joined: 06 Mar 2016, 21:07

Re: path/filename too long

#3 Post 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.

Locked