Help with identifying "paths" > 256 chars
Hoping one or more of you might be able to assist. We're trying to do an urgent move from Sharefile to Sharepoint/Onedrive and we're striking the file path limit in some home directories. We need a means to identify the file/folder combinations that are going to fail in transfer. Any help gratefully accepted. Cheers
Output Recursive directory listing to file with Dir /s > output.txt Throw that in excel. Add a new column, Use the LEN function to count characters for each line
Thank you unashamed! You set me on the right path - see what I did there? - :-)
Set-Location "S:\Shared Folders\person@domain"
Get-ChildItem -Recurse | % { $_.FullName } | out-file c:\temp\files.txt
$textfile = 'C:\Temp\files.txt' $headerfile = 'C:\Temp\header.txt' $(Get-Content $headerfile; Get-Content $textfile) | Set-Content $textfile
import-csv C:\temp\files.txt | foreach{ $file = $_.Filenames | Out-String if ($file.Length -gt 160){ write-host -nonewline $file.Length "-" $file } }