I have an old laptop that runs xp.
Lightning destroyed my desktop motherboard, cpu and powersupply so I needed my old laptop but its files were several years old.
When I tried to copy all files from my desktop's (w10) drive D: to my laptop, xp would not copy many of them because xp said the file names were illegal (the full path was too long).
Copying is a pain because xp stops copying files, shows an error message, and you have to guess which files were not copied, etc.
After some testing, I found that xp on my laptop would only copy paths up to 258 visible characters, over 258 resulted in error messages.
I want to locate these long path files and save their full paths to a file so I can shorten them or delete them, so that if I ever need to copy D: to my laptop in the future it won't take hours.
I started writing a script but read that atleast one ahk file command ignores files with paths that are over 259 characters which pretty much defeats the purpose of the script.
Hopefully someone out there knows an easy way to get ahk to find all file paths over 258 long.
Any help would be appreciated.
Locate all Files on D:\ with Paths longer than 258 Charaters
Re: Locate all Files on D:\ with Paths longer than 258 Charaters
Most commands support long paths in AutoHotkey v1.1.31 and later, but the OS still has limits. To get around them on XP, you must use a Unicode version of AutoHotkey and the \\?\ prefix, as in:
I would just use robocopy, but as it's not included in XP, you would need to find a copy somewhere.
Code: Select all
Loop Files, \\?\D:\*, FDR
if StrLen(A_LoopFileFullPath)-4 > 258
MsgBox % A_LoopFileFullPath
Re: Locate all Files on D:\ with Paths longer than 258 Charaters
lexikos,
thank you for you post
your code appears to work fine.
i would have thanked you sooner but selecting "Notify me when a reply is posted" never notified me of any postings.
thank you for you post
your code appears to work fine.
i would have thanked you sooner but selecting "Notify me when a reply is posted" never notified me of any postings.
Re: Locate all Files on D:\ with Paths longer than 258 Charaters
I prefer to shorten the pathname to avoid this issue, but if you have many paths, many tools can handle this issue easily like the Long Path Tool, Gs Richcopy 360, Long Path Fixer....etc.
Also I sea the code by lexikos, very helpful
Also I sea the code by lexikos, very helpful
Who is online
Users browsing this forum: No registered users and 212 guests