miércoles, 8 de agosto de 2012

How to fix the 250 character limit on Windows file copying

Share it Please

We are moving some folders from an old infrastructure to a new offering that we will deploy during the next days. During this migration process we have found some errors when we tried to move some folders that contain subfolders with long (very, very long) names. 

It seems that exist a 250 character limit on Windows file path, this is not a limitation of NTFS but a characteristic of Windows explorer shell.

The best way to avoid that is to use a command-line command named subst (well… the best way should be to teach to our customers how to work with a shared folder… name folders and subfolders using an average of more than 25 characters is not a best practice…).

From your command-line console type the following:

Subst v: “\\sourcefolder\path\to\my\ridiculous\extra\large\folder\and\sub\folder\name”
Subst w: “\\destinationfolder\path\to\my\ridiculous\extra\large\folder\and\sub\folder\name“

Now you can use, for example, a Robocopy command to copy the data from one folder to another one:

Robocopy v:\ w:\ /e /MT:128 /LOG:"D:\mytransfer.log"

When you finish your copy, you can unmap both paths using these other commands:

Subst v: /d
Subst w: /d


No hay comentarios:

Publicar un comentario

Project Mgmt. Professional

Project Mgmt. Professional

AWS Architect

AWS Architect

ITIL Fundamentals

ITIL Fundamentals