vb.net - How to copy file to a new location having path length more than 260 characters in vista? -


In my previous question, the following is as follows:

" To make a file copy 260 I have asked almost the same question and I have found a solution to change the name of the directory name and then copy it to a new location. But we can not change the name of the directory in any case according to customer's requirement.

So now my problem occurs when we try to copy a file of path length (with file name) more than 260 characters (say 267 characters) ), It allows us to copy manually but throws an exception programmatically in Vista OS

Please tell me if anyone has a solution.

If the problem is only with the length of the file (not the preceding path), then the file's short name Version (probabaly Outloo ~ 1.xls) can be used.

However, the only real viable solution is to use the Network Redirect or SUBST command to minimize the path, I can think that you have to keep track of the length of the path in your program, and when the length If it is exceeded then a SUBST drive letter will have to be created ... except for the drive letter, it is no longer necessary, strange programming, but no hope.

Or

I know that some unicode versions of Windows API functions (copyfilesx??) Can control 32,767 characters.

it \\? Try to name with \ Prefix, for example, \\? \ D: \. I'm not sure CLR uses this type of naming style, but you can give it a try.


Comments