I'm using code (from Windows batch: formatted date into variable ).
- How to get Mon=08 (2-digits), instead of Aug (3-alpha)?
What is syntax for MKDIR using a variable? With leading \ I get "The filename, directory name, or volume label syntax is incorrect." Without I get "access is denied."
@echo off setlocal for /f "skip=8 tokens=2,3,4,5,6,7,8 delims=: " %%D in ('robocopy /l * \ \ /ns /nc /ndl /nfl /np /njh /XF * /XD *') do ( set "dow=%%D" set "month=%%E" set "day=%%F" set "HH=%%G" set "MM=%%H" set "SS=%%I" set "year=%%J" SET "DESTINATION=%%J%%E%%F%%G%%H%%I-EXTRACTION" ) echo Day of the week: %dow% echo Day of the month : %day% echo Month : %month% echo hour : %HH% echo minutes : %MM% echo seconds : %SS% echo year : %year% echo DESTINATION : %DESTINATION% endlocal MKDIR \%DESTINATION%\