I think your script had something wrong. You can amend the script as below . There are two methods.
You can use this way ----
@echo off
cls
:: Create environment variables with today's date values.
setlocal
for /f "tokens=1-4 delims=/ " %%i in ('date /t') do (
set DD=%%i
set MM=%%j
set...