Windows batch

Windows batch : TODAY

Example

test1.bat

@echo off

rem 20160324
set TODAY1=%DATE:/=%
echo %TODAY1%


pause

test1.bat

@echo off

set yyyy=%date:~0,4%
set mm=%date:~5,2%
set dd=%date:~8,2%

rem 2016-03-24
echo %yyyy%-%mm%-%dd%test.txt
rem copy test.txt test.%yyyy%-%mm%-%dd%.txt


pause