following scenario:
i have written a batch script whitch adds the datestamp to the filename. There are lots of different file-types in the folder.
@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "datestamp=%YYYY%-%MM%-%DD%_"
:: naming like ISO 8601
pause
for %%i in (*.*) do ren %%i %datestamp%%%i*
is there a good way to exclude the bat-file itself from the renaming? It would be good enought if there is a way to exclude all .bat-files.