@echo off for %%a in (d e f) do ( cd /d %%a:\ for /r %%b in (*) do ( if "%%~nxb"=="1.doc" move "%%b" "e:\常用" if "%%~nxb"=="8.doc" move "%%b" "e:\其它" if "%%~nxb"=="200.exe" move "%%b" "e:\实用小软件" )) Remark:1.%~nx:file name and file extension only