%date:~10,4% = YEAR YYYY
%date:~4% = MONTH MM
%month-num% = MONTH MM (Renamed to Month Ex: January)
@ECHO
:begin
set space=" "
set month-num="%date:~4,2%"
:: Sets month number to name
if %month-num%=="01" ( set month-txt=January)
if %month-num%=="02" ( set month-txt=February)
if %month-num%=="03" ( set month-txt=March)
if %month-num%=="04" ( set month-txt=April)
if %month-num%=="05" ( set month-txt=May)
if %month-num%=="06" ( set month-txt=June)
if %month-num%=="07" ( set month-txt=July)
if %month-num%=="08" ( set month-txt=August)
if %month-num%=="09" ( set month-txt=September)
if %month-num%=="10" ( set month-txt=October)
if %month-num%=="11" ( set month-txt=November)
if %month-num%=="12" ( set month-txt=December)
:: Setting variable to 01
@setlocal enableextensions enabledelayedexpansion
set /a "i=1"
set day-num=!i!
:: Path to the drive location
SET PATH1="S:\FinAdj\Scanned_Batched_Work\%date:~10,4%\Manual_Batches"
:: This creates the first folder as default 1
mkdir "%PATH1%\%date:~4,2%_%month-txt%\"1"
:: Loop
:loop
if !i! leq 32 (
set day-num=!i!
:: Creating the folders
SET PATH1="S:\FinAdj\Scanned_Batched_Work\%date:~10,4%\Manual_Batches"
mkdir "%PATH1%\%date:~4,2%_%month-txt%\%day-num%\NAME1"
mkdir "%PATH1%\%date:~4,2%_%month-txt%\%day-num%\NAME2"
mkdir "%PATH1%\%date:~4,2%_%month-txt%\%day-num%\NAME3"
)
:: Breaker to end of routine when reaching 32
if !i!==32 goto end
:: Increament of i
set /a "i = i + 01"
goto :loop
:: Log
:Log
echo %username%, %date%, %time%, Created %date:~10,4%/%date:~4,2%_%month-txt%/%date:~7,2% Folder>> %PATH1%\log.txt
:end