Created
December 18, 2014 02:00
-
-
Save angusdev/764c1ae7b1e199275f46 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @REM Copy foo.txt to foo.20141218.txt | |
| @REM Assuming Window's date format is Mon 12/18/2014 | |
| @set FROMFILE=foo.txt | |
| @setlocal | |
| @echo off | |
| FOR /D %%f in (%FROMFILE%) do ( | |
| set TOFILE=%%~nf.%date:~10,4%%date:~4,2%%date:~7,2%%%~xf | |
| ) | |
| @echo on | |
| copy %FROMFILE% %TOFILE% | |
| @endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment