|simple requirement and above script without indention makes it hard to read, and some variable isn't utilized throughout the script after lots of if-else checking, eg. DIRCMD|
@echo off & setlocal enabledelayedexpansion
for /f "tokens=*" %%a in ('dir/b/s/l') do (
ren "%%a" "!f!"