@echo off for /f "delims=" %%a in (aaa.txt) do ( md "%%a" for %%b in (a b c d e) do copy "c:\%%b.txt" "%%a\" ) pause