我有一个目录结构
C:folder\
\davis\Myfiles\saved
\brown\Myfiles\saved
\smith\Myfiles\saved
\jones\Myfiles\saved
我想要实现的是这个
for each directory called 'Myfiles'
IF NOT Exists 'Myfiles\*doc.rtf'
copy files caled 'Myfiles\*doc.txt' to the subdirectory 'Myfiles\saved'
move files called 'Myfiles\*doc.txt' to 'somewhereElse'
但是如何使用批处理
答案 0 :(得分:1)
阅读HELP FOR
并试用可能有助于您入门的代码......
for /r /d %%a in (*) do (
if /i %%~na==myfiles (
pushd %%a
for %%b in (*doc.txt) do (
if not exist %%~nb.rtf (
echo copy %%b saved
echo move %%b \somehwereelse
)
)
popd
)
)