Link to home
Start Free TrialLog in
Avatar of McThump
McThump

asked on

Script to list long file paths

Can someone suggest a PowerShell script that will list all file paths over 260 characters in the current folder and subfolders?
ASKER CERTIFIED SOLUTION
Avatar of Jason Crawford
Jason Crawford
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try this in PowerShell.

Out-File c:\OutputFile.txt ; cmd /c "dir /b /s /a" | ForEach-Object { if ($_.length -gt 250) {$_ | Out-File -append c:\OutputFile.txt}}
Glad I could help.  Take care :)