@echo off :: arm directory args1 for /F "delims=" %%f in ('dir /b /s %1') do ( :: skip folders if not exist "%%~f\" ( :: skip files without .disarmed extension if ".disarmed" == "%%~xf" ( move "%%~f" "%%~dpnf" echo "%%~f" renamed to "%%~dpnf" ) ) ) @pause