"The specified path, file name, or both are too long."

May 9, 2012 at 7:01 AM

Hi,

I 've used PAL.ps1 script with long output parameters... and received following error:

Test-Path : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248characters.At \\computer\c$\Program Files\PAL\PAL v2.2.1\PAL.ps1:3956 char:45+                     $bFileExists = Test-Path <<<<  -Path $sFilePath    + CategoryInfo          : InvalidArgument: (\\computer\d$\...ations_sec1.png:String) [Test-Path], PathTooLongException    + FullyQualifiedErrorId : ItemExistsPathTooLongError,Microsoft.PowerShell.Commands.TestPathCommand
WARNING: Please post errors or problems with this tool to the PAL web site located at http://www.codeplex.com/PAL withthe following error message and a brief description of what you were trying to do. Thank you.Exception calling "SaveImage" with "2" argument(s): "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."At \\computer\c$\Program Files\PAL\PAL v2.2.1\PAL.ps1:1458 char:29+     [Void] $oPALChart.SaveImage <<<< ($sSaveFilePath, $oPALChartImageFormat)    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException    + FullyQualifiedErrorId : DotNetMethodException

For PAL development: Can specified path and file name length be 'expanded' to more than 260chrs?

Best regards,
Peter Eremic. 

May 9, 2012 at 12:52 PM

  I'm pretty sure you are running into the MAX_PATH limitation, which isn't specific to PAL or PowerShell, but Windows itself.  Google MAX_PATH and there's a lot out there are on the problem.

May 10, 2012 at 5:07 AM

Jap, you're right, sqlpadawan. Tnx.