Created
July 28, 2015 10:35
-
-
Save Cylindric/731071caa5976b975a39 to your computer and use it in GitHub Desktop.
This file contains 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
@ECHO OFF | |
setlocal EnableDelayedExpansion | |
FOR /F "skip=1 tokens=1-6" %%A IN ('WMIC Path Win32_LocalTime Get Day^,Hour^,Minute^,Month^,Second^,Year /Format:table') DO ( | |
if "%%B" NEQ "" ( | |
SET /A FDATE=%%F*10000+%%D*100+%%A | |
SET /A YEAR=%%F | |
SET /A MONTH=100+%%D | |
) | |
) | |
ROBOCOPY "YOUR_SOURCE_PATH" "YOUR_DESTINATION_PATH\!YEAR!-!MONTH:~-2!\" /MIR /R:5 /W:5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment