Repasando el codigo, me he dado cuenta que no habia puesto en GOTO :EOF detras del FOR.
He dejado el codigo tal que asi:
@ECHO OFF
CLS
ECHO.
PUSHD C:\Temp
FOR /L %%i IN (1,1,12) DO ( CALL :Mes %%i)
GOTO :EOF
: Mes
SET Meses=JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER
FOR /F "Tokens=%1" %%a IN ("%Meses%") DO (
IF %1 GEQ 10 (
ECHO %1-%%a
REM MKDIR %1-%%a
) ELSE (
ECHO 0%1-%%a
REM MKDIR 0%1-%%a
)
)
GOTO :EOF
Y la salida me queda ahora como yo queria.
01-JANUARY
02-FEBRUARY
03-MARCH
04-APRIL
05-MAY
06-JUNE
07-JULY
08-AUGUST
09-SEPTEMBER
10-OCTOBER
11-NOVEMBER
12-DECEMBER
C:\temp>
He dejado el codigo tal que asi:
@ECHO OFF
CLS
ECHO.
PUSHD C:\Temp
FOR /L %%i IN (1,1,12) DO ( CALL :Mes %%i)
GOTO :EOF
: Mes
SET Meses=JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER
FOR /F "Tokens=%1" %%a IN ("%Meses%") DO (
IF %1 GEQ 10 (
ECHO %1-%%a
REM MKDIR %1-%%a
) ELSE (
ECHO 0%1-%%a
REM MKDIR 0%1-%%a
)
)
GOTO :EOF
Y la salida me queda ahora como yo queria.
01-JANUARY
02-FEBRUARY
03-MARCH
04-APRIL
05-MAY
06-JUNE
07-JULY
08-AUGUST
09-SEPTEMBER
10-OCTOBER
11-NOVEMBER
12-DECEMBER
C:\temp>