Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move folder/files with path names > 255 characters in Windows 8.1? [closed]

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.

like image 375
Automatico Avatar asked Dec 01 '22 17:12

Automatico


2 Answers

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).

like image 41
Ian Avatar answered Dec 04 '22 06:12

Ian


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

like image 181
Automatico Avatar answered Dec 04 '22 07:12

Automatico