cls @echo off SETLOCAL ENABLEDELAYEDEXPANSION
set d_rep=%1 set w_fic=%2
for /F "tokens=1-4 delims=/" %%a in ('echo %date:~4,10%') do set w_date=%%c%%a%%b for /F "tokens=1-4 delims=:" %%a in ('echo %time:~0,8%') do set w_time=%%a%%b%%c
dir %d_rep%%w_fic%
if EXIST %d_rep%%w_fic%. ( for /r "%d_rep%" %%i in (%w_fic%) do ( echo. set wf_name=%%~ni set we_name=%%~xi rem set f_out=!wf_name!_%w_date%_%w_time%!we_name! set f_out=%w_fic%.%w_date%_%w_time% ren %d_rep%%w_fic% !f_out! ) )
dir %d_rep%!f_out!