CODE: [Copy to clipboard]@echo off setlocal enabledelayedexpansion for %%a in ("*.txt") do ( set CurFile=%%~na set FstChar=!CurFile:~0,1! md !FstChar! 2>nul move "%%~fa" !FstChar! )