cmdref.net - Cheat Sheet and Example

cmdref.net is command references/cheat sheets/examples for system engineers.

User Tools

Site Tools


Sidebar








Cloud



Etc


Reference














.

programming:batch:today.html



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



programming/batch/today.html.txt ยท Last modified: 2016/03/24 by admin

Page Tools