@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%i in ('dir/a-d/b/s "D:\a\*.rar"') do (set /a n+=1
if !n! leq 100 (move "%%i" "D:\b\"))
pause
@echo off&setlocal enabledelayedexpansion
for /r "D:\a" %%i in (*.rar) do (set /a n+=1
if !n! leq 100 (move "%%i" "D:\b\"))
pause
个人认为第二种比较好用