liaoguinan 当前在线
二级士官
评分人数
pd1 当前离线
五级士官
@echo off set "path=E:\测试\" for /f "delims=" %%a in ('dir /b/s /a-d %path%*.pdf') do call :m %%a for /f "delims=" %%a in ('dir /b/s /ad %path%') do rd %%a 2>nul pause&exit :m pushd %~dp1 cd.. move %1 %cd% popd复制代码
TOP
77七 当前在线
中校
@echo off rem 批处理保存为ansi编码格式 cd /d "e:\测试" || exit (for /d %%d in (*) do ( for /d %%e in ("%%d\*") do ( move /-y "%%e\*.pdf" "%%d" if errorlevel 0 ( rd "%%e" ) ) )) 2>nul pause复制代码
Five66 当前离线
上尉
@echo off for /d %%a in (*) do ( for /f "delims=" %%b in ('dir /s /b "%%~fa\*.pdf"') do ( if "%%~dpb" neq "%%~fa\" ( if not exist "%%~fa\%%~nxb" ( move "%%b" "%%~fa\" ) else ( move "%%b" "%%~fa\%%~nb___%%~nxb" ) ) rd "%%~dpb" 2>nul ))复制代码
terse 当前离线
中将
qixiaobin0715 当前离线
大校
@echo off for /f "delims=" %%i in ('dir /s /b /a-d *.pdf') do ( move "%%i" "%%~dpi..">nul 2>nul if not exist "%%~dpi.\*.pdf" rd "%%~dpi" 2>nul ) pause复制代码