Windows下删除过长路径下文件(夹)的办法

  有时候在Windows下删除文件或文件夹会碰到如下错误:

The source file name(s) are larger than is supported by the file system. Try moving to a location which has a shorter path name, or try renaming to shorter name(s) before attempting this operation.

文件名对目标文件夹可能过长。您可以缩短文件名并重试,或者尝试路径较短的位置。

image

  解决的办法是在命令行输入:

robocopy /MIR c:\a d:\xxx

  其中c:\a是c盘新建的一个空目录,d:\xxx是路径过长的文件(夹)的根目录。执行后,你会发现d:\xxx目录已经被清空了。

2 thoughts on “Windows下删除过长路径下文件(夹)的办法”

  1. zenwalk

    如果有winrar的话,可以右键文件夹,选择将文件夹添加到压缩文件
    然后在弹出的对话框里,勾选上“压缩完删除文件”

Leave a Comment

Your email address will not be published. Required fields are marked *