![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Removing long paths Heya, I run into following problem - while trying to remove folder with long name (stored on networks and needs to be accessed by FQDN), Remove- Item reports following: Remote-Item : 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. Of course you can delete that folder from Explorer and even worse, you can delete it from cmd ![]() As a current workaround, I have to call Cmd /c RmDir /s /q "$FolderPath" I guess that limitation comes from API, but it's not very nice. Any ideas? Or at least, could we get it in next Posh version (as far as I remember, NTFS limitation is 32,000 characters) ![]() Martin |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Removing long paths Does it work if you creat a new psdrive at some point down the FQDN and do your remove-item referenced from there? "Martin Zugec" wrote: Quote: > Heya, > > I run into following problem - while trying to remove folder with long > name (stored on networks and needs to be accessed by FQDN), Remove- > Item reports following: > Remote-Item : 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. > > Of course you can delete that folder from Explorer and even worse, you > can delete it from cmd ![]() > > As a current workaround, I have to call Cmd /c RmDir /s /q > "$FolderPath" > > I guess that limitation comes from API, but it's not very nice. > > Any ideas? Or at least, could we get it in next Posh version (as far > as I remember, NTFS limitation is 32,000 characters) ![]() > > Martin > . > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Removing long paths Hi Rob, yes, it works, but that's just workaround. Problem is that I run into this in my framework and I don't know how it's going to be used, so I need solution that will work everywhere\everytime ![]() I am annoyed because these folders can be deleted from explorer\cmd, but not from powershell Martin |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Removing long paths http://www.codinghorror.com/blog/archives/000729.html has a discussion of this limitation of the Windows API. - Larry Martin Zugec wrote: Quote: > Heya, > > I run into following problem - while trying to remove folder with long > name (stored on networks and needs to be accessed by FQDN), Remove- > Item reports following: > Remote-Item : 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. > > Of course you can delete that folder from Explorer and even worse, you > can delete it from cmd ![]() > > As a current workaround, I have to call Cmd /c RmDir /s /q > "$FolderPath" > > I guess that limitation comes from API, but it's not very nice. > > Any ideas? Or at least, could we get it in next Posh version (as far > as I remember, NTFS limitation is 32,000 characters) ![]() > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Removing long paths Hi Larry, yes, I know that link, however why is PowerShell using this older API and limiting itself? ![]() Martin |
My System Specs![]() |
| | #6 (permalink) |
| Ultimate 32 | Re: Removing long paths Martin, Have you just simply tried shortening the paths? |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Removing long paths Comments by Microsoft at https://connect.microsoft.com/PowerS...dbackID=276235 are interesting. Posted by Microsoft on 1/13/2009 at 8:16 AM None of PowerShell inherently has the path length limitations -- it all comes from the .NET Framework. There is a working group around removing this restriction, and we met with the CLR feature crew to discuss it as it relates to PowerShell before the holiday break. They will be putting a wrapper class on CodePlex in the near future for SOME support, with full support coming to the real FileInfo and DirectoryInfo types in the next verison of the CLR. - Larry Martin Zugec wrote: Quote: > Hi Larry, > > yes, I know that link, however why is PowerShell using this older API > and limiting itself? ![]() > > Martin |
My System Specs![]() |
| | #8 (permalink) |
| | Re: Removing long paths @Lancelot: that would be easiest solution, however is not possible : ( My solution is exporting parts of SCCM - configuration is exported to XML files and sources are exported also. I run into this limitation when handling with applications like XenApp or some Adobe products, that likes to store some files in locations like "Bin\Program Files \Adobe\Acrobat Reader..." @Larry: Interesting - I hope it will be available as soon as possible, because this is pretty dangerous situation (especially when cmd and explorer supports longer paths) |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Cannot delete filenames/paths too long!! | Vista file management | |||
| Long paths | VB Script | |||
| File Paths Too Long | Vista file management | |||
| Looking for function to resolve VirtualStore paths to physical paths | Vista file management | |||
| Looking for function to resolve VirtualStore paths to physical paths | Vista General | |||