Friday, September 5, 2008

Cannot copy (filename): The filename, directory name, or volume label syntax is incorrect.

One of the products I test is available for download, in addition to being available on CD media. We use WinZip to create a single-file self-extracting downloadable version. Our customers are able to download a ProdName.exe file, and run it to extract the CD image to a local or network folder.

Sometimes, depending on where they extract it to, they get an error. The problem is that our product CD incorporates the SQL Express installer, which has a very deep folder structure of its own. The longest path in the product CD folder structure is 186 characters:

\Bin\3rdParty\SQLExpress\setup\program files\microsoft sql server\90\tools\binn \windows\winsxs\3kn09qps.lm8\x86_microsoft.vc80.mfcloc_1fc8b3b9a1e18e3b_ 8.0.50727.42_x-ww_3415f6d0.manifest

If someone attempts to extract the contents to a directory that has a long path already, they can get this error:

Cannot copy (filename): The filename, directory name, or volume label syntax is incorrect.

Or, if they're able to extract it successfully, sometimes they get this error when they try to copy the entire CD directory to a different location:

Can't create output file: (filename)

The errors occur because the maximum length of a Windows path is 260 characters.

The solution is to extract or copy the install to a folder with a shorter path name. In our case, because our sub-path takes up 186 characters, everything that comes before \Bin... must have a length not more than 74 characters.

3 comments:

John Frag said...

This tool can delete/copy/rename long path files/folders
www.longpathtool.com

Adam Balich said...

I suggest you try Long path tool is the very good program for easily delete, copy & rename long path files, error, unlock solution.
Try it and solve your problem.
I used long path tool and I solve my error, unlock problem solution.

Beautiful blog said...

I suggest you Long Path Tool will let you easily delete, copy or rename long path files, you can try it for better service.