开心旺旺 当前离线
上等兵
评分人数
pcl_test 当前离线
荣誉版主
@echo off for /r "E:\test\" %%a in (*.txt *.pdf) do ( if /i "%%~xa" == ".txt" move "%%a" "D:\txt\" if /i "%%~xa" == ".pdf" move "%%a" "D:\pdf\" ) pause复制代码
TOP
@echo off for /f "delims=" %%a in ('dir /ad /s /b "D:\test\"') do ( if exist "%%a\*.txt" md "D:\txt\%%~na\" 2>nul & move "%%a\*.txt" "D:\txt\%%~na\" if exist "%%a\*.pdf" md "D:\pdf\%%~na\" 2>nul & move "%%a\*.pdf" "D:\pdf\%%~na\" ) pause复制代码