K:\bin>type get_date_without_space.bat
SET DATE_WITH_SPACE=%DATE%
FOR /F "TOKENS=1-2" %I IN ("%DATE_WITH_SPACE%") DO SET DATE_WITHOUT_SPACE=%I_%J
ECHO %DATE_WITHOUT_SPACE%
Это не работает Зачем?
K:\bin>get_date_without_space.bat
K:\bin>SET DATE_WITH_SPACE=Fri 11/16/2018
DATE_WITH_SPACEI_J was unexpected at this time.
K:\bin>FOR /F "TOKENS=1-2" DATE_WITH_SPACEI_J
K:\bin>