i am working on ffmpeg
screen capture and i wan\'t it to start recording on start up, so i need to give the output video file a name that is different every time i
**edited to separate date and time with _
If you only need it for unique filenames, don't mess around with the special chars and localized format. You can use:
for /f "tokens=2 delims==" %%i in ('wmic os get localdatetime /value') do set DateTime=%%i
set DateTime=%DateTime:~0,8%_%DateTime:~8,6%
REM or: set filename=%DateTime:~0,8%_%DateTime:~8,6%.flv
echo %DateTime%
EDIT to "the problem is the file name is like this 20140204_161529 and i wan't it to be like that 2014_02_04_16_15_29" : Use this inside the for
loop:
set oldfilename=%DateTime:~0,8%_%DateTime:~8,6%.flv
set newfilename=%DateTime:~0,4%_%DateTime:~4,2%_%DateTime:~6,2%_%DateTime:~8,2%_%DateTime:~10,2%_%DateTime:~12,2%.flv