When file names are too long and windows won’t delete or rename for that reason, and dir /x doesn’t work in CMD, here’s one way to delete the file<\/p>\n
<\/p>\n
Find the path of the file with the filename that is too long to delete<\/p>\n<\/div>\n
<\/p>\n
Navigate to the file, as if your going to create an archive withing the 7-zip or winrar application, right click on the file (or F2) and choose rename. Give the file a shorter name.<\/p>\n<\/div>\n
Success! the file now has a shorter name and can be deleted.<\/p>\n<\/div>\n
This worked well for me after my other option didn’t work, opening the directory in a command prompt and using dir /x to display shorter names and deleting from there. The only listing it would give me would be the long file name again. Hope this helps someone<\/p>","step":[{"@type":"HowToStep","name":"Locate file that is too long","text":"\n\n\nFind the path of the file with the filename that is too long to delete","image":"https://us1.discourse-cdn.com/spiceworks/original/4X/9/5/6/95683526c6e72cc925772c2261789941f0d350d5.jpeg"},{"@type":"HowToStep","name":"Open 7-zip or winrar","text":"\n\n\nNavigate to the file, as if your going to create an archive withing the 7-zip or winrar application, right click on the file (or F2) and choose rename. Give the file a shorter name.","image":"https://us1.discourse-cdn.com/spiceworks/original/4X/0/3/5/0356cde9960cd2cfc57822065db2a706791e63c6.jpeg"},{"@type":"HowToStep","name":"You can now delete the file in file explorer","text":"\nSuccess! the file now has a shorter name and can be deleted."}]}
\nThis method of renaming within 7-zip seems much simpler than the MS article outlining other ways of deleting a file with a filename too long, Can't delete files on NTFS file system - Windows Server | Microsoft Learn<\/a><\/p>\n