如何在Windows中查找路径长度大于260个字符的文件? [英] How do I find files with a path length greater than 260 characters in Windows?
问题描述
我在XP Windows脚本中使用xcopy递归复制目录.我一直收到内存不足"错误,我知道这是因为我要复制的文件路径太长.我可以轻松地减小路径长度,但是不幸的是,我无法确定哪些文件违反了路径长度限制.复制的文件被打印到标准输出(我将其重定向到日志文件),但是错误消息被打印到终端,所以我什至无法估算出错误所在的目录
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 trying to copy has too long a path. I can easily reduce the path length, but unfortunately I can't work out which files are violating the path length restriction. The files that are copied are printed to the standard output (which I'm redirecting to a log file), but the error message is printed to the terminal, so I can't even work out approximately which directory the error is being given for.
推荐答案
执行dir /s /b > out.txt
,然后在位置260处添加指南
do a dir /s /b > out.txt
and then add a guide at position 260
在powershell cmd /c dir /s /b |? {$_.length -gt 260}
In powershell cmd /c dir /s /b |? {$_.length -gt 260}
这篇关于如何在Windows中查找路径长度大于260个字符的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!