MS DOS command to append timestamp in file name

echo %date:~-4,4%%date:~-10,2%%date:~-7,2%_%time:~0,2%%time:~3,2%%time:~6,2%-OUTPUT.txt

Would return (example):

20171409_152203-OUTPUT.txt

Advertisements

MS DOS command to rename files in folder

for /f “delims=” %%i in (‘dir /b /a-d *.txt’) do ren “%%~i” “Prefix%%~niSuffix%%~xi”

This line can be inserted in a batch file (*.bat), it will apply to all files with “txt” extension where the command is run, and will add “Prefix” as prefix, “Suffix” as suffix: you may adapt as needed!