cmd prompt命令有问题:
for /r E:\ %f in (*.jpg) do @move "%f" "E:\jpg" /Y
此命令行不按我预期的方式工作。我试图将我的外部驱动器上的某些类型(即jpg)上的所有文件移动到我的外部驱动器上的文件夹(E:/ jpg)
有什么建议???
Microsoft Windows [Version 10.0.16299.125]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\█████>for /r E:\ %f in (*.jpg) do @move "%f" "E:\jpg" /Y
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
Microsoft Windows [Version 10.0.16299.125]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\█████>for /r E:\ %f in (*.jpg) do @move "%f" "E:\jpg"
Overwrite E:\jpg\10255420_10200945699085042_5035519864603771578_n.jpg? (Yes/No/All): Yes
1 file(s) moved.
Overwrite E:\jpg\10307411_10201163984180409_2977646430196181302_n.jpg? (Yes/No/All):
对于移动文件,您可以使用robocopy而不是move,默认情况下它不会覆盖目标文件,除非它们具有不同的大小或时间戳,并处理多个文件。
你应该可以使用它
robocopy %cd% "E:\jpg" *.jpg /MOV
注意:cd
是当前目录的环境变量