Batch File: get and Separate DATE

use this to separate out the year month and day to variables to use in backup scripts

@setlocal
@echo off
@For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @(
Set Month=%%A
Set Day=%%B
Set Year=%%C
)


Then use them like this to create a daily unique filename
mkdir c:\Backup\%Year%\%Month%%Day%
This will create a folder that looks like c:\Backup\2017\0501