How to copy a file to a new location with a path length of more than 260 characters in Vista?

in my previous question as follows:

" How to create a copy of a file longer than 260 characters .

I asked almost the same thing, and I have a solution to rename the directory name and then copy to a new location. But at the request of the client, we can not rename the directory in any case.

So, now my problem is that we are trying to copy a file with a path length (including file name) of more than 260 characters (say 267 characters), this allows us to copy manually, but throws an exception programmatically in the OS.

Please let me know if anyone has a solution.

+3
source share
3

( ), (probabaly Outloo ~ 1.xls).

SUBST . , SUBST ... , . , .

unicode windows api (copyfileex..? http://msdn.microsoft.com/en-us/library/aa363852(VS.85).aspx) 32 767 .

\\? \, , \\?\D: \. , CLR , .

+1

\\?\ , 32767 . :

copy \\?\C:\big\dir\hierarchy\myfile.txt \\?\C:\tohere.txt

.

DIR WinXP, .

+3

, , 7zip, Vista.

, , " " :

  • /, .
  • .zip/.rar
0

Source: https://habr.com/ru/post/1702409/


All Articles