Code: Select all
@echo off & setlocal
for /r /d %%a in (*) do call:strip "%%a"
for /r %%a in (*) do call:strip "%%a"
goto:eof
:strip
set app=%~n1&set ver=
set app=%app:v0=&set ver=v0%
set app=%app:v1=&set ver=v1%
set app=%app:v2=&set ver=v2%
set app=%app:v3=&set ver=v3%
set app=%app:v4=&set ver=v4%
set app=%app:v5=&set ver=v5%
set app=%app:v6=&set ver=v6%
set app=%app:v7=&set ver=v7%
set app=%app:v8=&set ver=v8%
set app=%app:v9=&set ver=v9%
set app=%app:.= %
set app=%app:KILLERS=%
if /i "%~nx1" neq "%app%%ver%%~x1" (
set pad=%app%
echo Renaming App : %pad:~,25% Ver : %ver% Ext : %~x1
ren "%~1" "%app%%ver%%~x1"
)