:: 查找并剪切所有PSD文件到目标目录 for %%F in (*.psd) do ( echo Moving %%F to !target_dir! move "%%F" "!target_dir!" ) echo All PSD files moved to !target_dir! pause 以上代码,谁给加上点东西,如果有重名文件则不移动
可以这样 :: 查找并剪切所有PSD文件到目标目录 set target_dir=../target for %%F in (*.psd) do ( echo Moving %%F to %target_dir% echo No|move /-Y "%%F" "%target_dir%" ) echo All PSD files moved to %target_dir% pause