How do I find files with a path length greater than 260 characters in Windows?

后端 未结 8 1986
时光取名叫无心
时光取名叫无心 2020-12-04 06:11

I\'m using a xcopy in an XP windows script to recursively copy a directory. I keep getting an \'Insufficient Memory\' error, which I understand is because a file I\'m tryin

8条回答
  •  忘掉有多难
    2020-12-04 06:44

    As a refinement of simplest solution, and if you can’t or don’t want to install Powershell, just run:

    dir /s /b | sort /r /+261 > out.txt
    

    or (faster):

    dir /s /b | sort /r /+261 /o out.txt
    

    And lines longer than 260 will get to the top of listing. Note that you must add 1 to SORT column parameter (/+n).

提交回复
热议问题