@echo off & title 归类指定文件 By 依梦琴瑶
cd /d %~dp0
for /d %%a in (*) do (
pushd "%%~a"
for /d %%b in (*) do (
pushd "%%~b"
for /d %%c in (*) do (
pushd "%%~c"
for /f "delims=" %%d in ('dir /a-d/b *.tif,*.jpg') do (
echo "%%~nd" | findstr /bi """FM" >nul 2>nul && (
if not exist "封面" md "封面"
move "%%~d" "封面\"
)
echo "%%~nd" | findstr /bi """ML" >nul 2>nul && (
if not exist "目录" md "目录"
move "%%~d" "目录\"
)
echo "%%~nd" | findstr /bi """BKB" >nul 2>nul && (
if not exist "报表" md "报表"
move "%%~d" "报表\"
)
)
popd
)
popd
)
popd
)
pause
新建一个文件,1.cmd,把下面内容考进去,保存,然后双击运行 @echo off set /p dir1=需要复制的文件夹 set /p dir2=目的文件夹 xcopy "%dir1%" "%dir2%" /e /i /y @pause