楼上代码多了一次移动,修改后效率要高一些:- @echo off
- set folder1=零散文件夹
- set folder2=目标文件夹
- cd %folder1%
- (for /f "delims=" %%i in ('dir /b /ad') do (
- for /f "tokens=4,5 delims== " %%a in ('type "%%i\*.tf"') do (
- if "%%a"=="Code" (
- if not exist "%%~dpi..\%folder2%\%%~b" md "%%~dpi..\%folder2%\%%~b"
- move "%%i" "%%~dpi..\%folder2%\%%~b"
- )
- )
- ))>nul 2>nul
- pause
复制代码
|