问题
How can you copy/move a folder or file with path name length > 255 on windows?
I have looked around for ages, and the only possible way I have found is to use the subst
method. I wish I didn't have to mess about with this. I simply want to copy/move a file or directory, X
, to location Y
.
I'm fine with making a .bat
script, or other kinds of scripts to achieve this.
PS: this is marked as of topic, which I'm fine with, but it was being done in a programming context.
回答1:
I finally found a good solution!
The savior is
Robocopy
Robocopy supports path names > 256 by default, and even provides a flag that lets you turn OFF support for long path names (flag: /256
).
Example usage of Robocopy:
robocopy /E C:/path/with/very/long/names/in/it C:/new/path
回答2:
Not Windows 8 but in Windows 7, 64bit, I have the same problem and I just discovered that while nothing else worked, I was able to cut and paste folders containing files with path names that were too long into a destination folder with a shorter path. That is, in Explorer.exe, I selected a directory that I couldn't delete because some files had path names that were too long, then CTRL-X to cut it and paste it into another explorer window (CTRL-V).
来源:https://stackoverflow.com/questions/29865863/how-to-move-folder-files-with-path-names-255-characters-in-windows-8-1