移动:文件名或扩展名太长 [英] move: The filename or extension is too long
本文介绍了移动:文件名或扩展名太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在bat文件中写了一个小脚本,用于在计算机上创建文件夹的备份:
I wrote a small script in a bat file that I use to create backups of a folder on my computer:
rmdir "Folder - Backup (Old)" /S /Q
move "Folder - Backup" "Folder - Backup (Old)"
mkdir "Folder - Backup"
xcopy /e /h "Folder"\*.* "Folder - Backup"
我最近将文件夹"和备份脚本一起移到了新目录,现在该脚本无法使用:
I recently moved "Folder" along with the backup script into a new directory and now the script isn't working:
move "Folder - Backup" "Folder - Backup (Old)"
The filename or extension is too long.
0 dir(s) moved.
我猜这是由于Folder
的完整文件路径太长引起的,但是当我使用Windows资源管理器重命名文件夹时,我没有这个问题,所以这并不是说无法在Windows中执行此操作视窗.是否有解决此问题的方法?
I'm guessing this is caused by the full file path of Folder
being too long, but I don't have this problem when I rename the folder using Windows Explorer so it's not like this operation isn't possible in Windows. Is there a work-around for this problem?
推荐答案
使用move
重命名是过分的.试试
Using move
to do a rename is overkill. Try
ren "Folder - Backup" "Folder - Backup (Old)"
这篇关于移动:文件名或扩展名太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文