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

后端 未结 8 1976
时光取名叫无心
时光取名叫无心 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:50

    you can redirect stderr.

    more explanation here, but having a command like:

    MyCommand >log.txt 2>errors.txt
    

    should grab the data you are looking for.

    Also, as a trick, Windows bypasses that limitation if the path is prefixed with \\?\ (msdn)

    Another trick if you have a root or destination that starts with a long path, perhaps SUBST will help:

    SUBST Q: "C:\Documents and Settings\MyLoginName\My Documents\MyStuffToBeCopied"
    Xcopy Q:\ "d:\Where it needs to go" /s /e
    SUBST Q: /D
    

提交回复
热议问题