Im using a xcopy in an XP windows script to recursively copy a directory. I keep getting an 'Insufficient Memory' error, which I understand is because a file I'm trying to copy has too long a path. I can easily reduce the path length, but unfortunately I can't work out which files are violating the path length restriction. The files that are copied are printed to the standard output (which I'm redirecting to a log file), but the error message is printed to the terminal, so I can't even work out approximately which directory the error is being given for.
I've also written and blogged about a simple PowerShell script for getting file and directory lengths. It will output the length and path to a file, and optionally write it to the console as well. It doesn't limit to displaying files that are only over a certain length (an easy modification to make), but displays them descending by length, so it's still super easy to see which paths are over your threshold. Here it is:
Crazily, this question is still relevant. None of the answers gave me quite what I wanted although E235 gave me the base. I also print out the length of the name to make it easier to see how many characters one has to trim.
The Windows path length only refers to apps using some of the api set. Applications that use unicode api can extend the path length to 32,767 characters ( Naming Files, Paths, and Namespaces - Win32 apps Microsoft Learn ). Most current application, including Unitrends, no longer have issues with long path names.
Some interfaces in Windows still use the standard API and will limit you to 256 character paths, but you can bypass this using \?\c:. I used to create long paths to test management, monitoring and security applications. Its easy to do, create a path close to 256 characters, then share it. Map a drive to a share, then keep going.
You can use vbscript objFile.Path and use string manipulations to get the path length. I was about to write up something simple, but found something that looks fairly complete from a resource I use frequently:
In my organization, while IT manages networked drive backups, local drive backups are the user responsibility. I xcopy my local Windows XP hard drive to the network drive weekly using xcopy with the /D switch. I have never failed to find what I need when searching the shared drive, but one always wonders, can you be absolutely sure that an xcopy based back-up to the network is really reliable?
A quick work-around to rapidly find and correct the 100 or so path length problems (as it turned out) was to cmd, dir >temp.txt, import the temp.txt directories into Excel, use formulas to append the appropriate directory onto each filename, and length test the resultant string. Excel allows you to search for only the exceptions and then to hyperlink to the offending directory, which is not terribly inefficient. Then manually minimize filename and folder name lengths starting with filename and working backwards until each fits within 250 or so characters.
As Ohio State migrates from Box to OneDrive and Teams (or Sharepoint), one of the larger concerns is the risk of file and folder path length. While Box allowed very long paths, there is a limitation on OneDrive/Teams of 400 characters or less.
OTDI will migrate your files into your individual OneDrive or a Team, depending if the files are in a unit folder or not. their tool will come back asking you to shorten paths, if necessary, but being informed beforehand can make it smoother. If you do choose to migrate on your own, please remove the old Box files so OTDI doesn't need to migrate them.
More information from Microsoft about invalid file names, types, and other limitations: Invalid file names and file types in OneDrive and SharePoint - Office Support (
microsoft.com), and also see the Teams and OneDrive Introduction in the related articles section.
This is one possible tool which can be used to scan a computer directory, and enumerate the files present and their path length from the chosen starting root folder. While this is seemingly intended for local storage paths, it seems to work when pointed to folders mounted via Box Drive.
(NOTE: Right now, Symantec seems to throw a false positive on this as of the latest version 1.8.2, though this was not the case with version 1.6.0. It claims "WS.Reputation!" because it's an obscure app with small sample size. But it's open source so that can be scrutinized by anyone who cares.)
We do not recommend using the "search pattern" or "replace" options. Ignore those for the time being. Whenever you use an automated tool to make changes, large mistakes are possible. We recommend shortening the paths indvidiaully.
Click "Get Path Lengths" and then wait. It may take some time depending on how large of a folder you're searching. There is no progress bar or status updates until it finishes. For example, a "very long" directory on Box Drive may take 45 minutes. A very small folder on local computer would be nearly instantaneous.
Note that in these results, the shortest path is still 47 chars. That is the full length of the shortest file name at the root of my folder, in this case: "C:\Users\canale.6\Box\Office Materials\test.pdf". Therefore if you want to be precise in character count, you need to consider the length of your root folder and subtract that value. BECAUSE the destination path in teams/sharepoint WILL NOT reflect the c:\users... part. It will start counting at "Office Materials".
Path Length Checker is a free stand-alone app that allows you to specify a root directory, and it gives you back a list of all paths (i.e. files and directories) in that root directory and their lengths. It includes features such as pattern matching and min/max length constraints, as well as the ability to specify a string that should replace the root directory in the results brought back, allowing you to quickly see path lengths if you were to move the files/folders to another location.
I'm working in laser cut and very often I need to know how long is the path I'm going to print with the machine. It is very useful to know the length (and the area) of each path directly while you're designing in Illustrator.
I tried Telegraphics plug-ins on CS6 but they does'nt work. Tried to write to the developer's team unsuccesfully; according to some forums, it seems right now it doesn't exist any option to let them work on CS6.
I have no scripting knowledge to do it myself and I am in need of some help. Actually there are some fairy daft people in our studio who cannot add, subtract or multiply properly and they are making our studio as a whole look like imbeciles. If we had a script that we could run through an Illustrator Action then we could likely put an end to the 3" x 1" label having an area of slightly over 5 square inches. Yes. I know.
Currently, running the above scripts on a complex compound path (let's just say a Swiss cheese, square shape for ease of visualization) will result in the addition of each path's area. For instance, the outer square will be one path and each hole in the piece of cheese is another path. All of these paths are added together to give a result of much more than the area of the outside square if it had no holes in it.
My suggestion to our IT guy to solve this (which would still work for simple shapes as well) was to ask the script to subtract any smaller value from any larger value until there was only one value left. He said that is a pretty simple script to write, but he is very busy and hasn't had time to do it. It's been over 7 months. I hate bugging him for it because his daily problems are more crucial to the business than a simple script for one of the hundred softwares we are using. It probably seems like a trivial thing for him and I don't fault him for that.
I am usually pretty good at reverse engineering, so figuring out what the language in the script above related to and what it did was easy enough. I just have no new language to throw at it to ask it to do the rest. Every attempt I've made to alter the script above to suit my needs resulted in utter failure. It was sort of like trying to order Chinese food from an Italian menu using musical notes and hand grenades - I know I want food, this place makes food, can it make this kind of food if I throw enough random nonsense at it? Not likely. I gave up and decided to ask for help.
I wish Adobe would add measurement values for object area into the Document Info panel. It's nice being able to quickly and easily determine path lengths in that panel, but path area is an equally important value. The old Telegraphics Path Area plug-in was great for that (it would provide both path length and area of any selected objects).
One alternative is using the Dynamic Measure tool in Astute Graphics' VectorScribe plug-in. It has all sorts of useful features. Unfortunately the user must manually select (or hover on the edge of) paths one at a time using the Dynamic Measure tool to see path length and area. Then you have to write down the results of each path and add the values to get the total. That's a kludge. There is no way to select multiple objects, such as a group of letters you're going to cut out of aluminum on a routing table, all at once and get an area value. The old Telegraphics plug-in did that in a snap.
I am new to Affinity Designer and already have searched the internet to find an answer. The Info I found is that the measurement tool was planned years ago, but nothing to measurements in the newest release.
Hello, my vote for the measure tool. I just need the most basic tool, to measure the distance from two points on canvas. I've seen several workarounds to meause the distance between two points, but the best is to have a tool that could measure distante from point A and point B. Just click/select point A, then point B, get the measure in pixels, inches, centimeters, etc ... done.
Yep v1.6.1 and still waiting for this. It's sound insane, but my current workflow means I design in Affinity and then measure in AI. So I'm paying Adobe to be able to measure my paths... Please add path measurements if only to help me break the last chain from CC subscription sentence. : )
3a8082e126