Malegik79
Код: @echo off
setlocal enabledelayedexpansion
set date=%data%
if %date:~0,1%==0 (
set /a dd=%date:~1,1%
) else (
set /a dd=%date:~0,2%
)
if %date:~3,1%==0 (
set /a mm=%date:~4,1%
) else (
set /a mm=%date:~3,2%
)
set /a yyyy=%date:~-4%
set /a ficsyyyy=2007
set /a daysago=0
call:kountdays
set /a daysago=%daysago%-7*(%daysago%/7)
set /a week=1
set /a monday=%dd%-%daysago%
call :numweek
call :nummonth
md "%month%_%week%" 1>nul 2>&1
goto:eof
:nummonth
if %mm%==1 (set month=Jan&goto :EOF)
if %mm%==2 (set month=Feb&goto :EOF)
if %mm%==3 (set month=Mar&goto :EOF)
if %mm%==4 (set month=Apr&goto :EOF)
if %mm%==5 (set month=May&goto :EOF)
if %mm%==6 (set month=Jun&goto :EOF)
if %mm%==7 (set month=Jul&goto :EOF)
if %mm%==8 (set month=Aug&goto :EOF)
if %mm%==9 (set month=Sep&goto :EOF)
if %mm%==10 (set month=Oct&goto :EOF)
if %mm%==11 (set month=Nov&goto :EOF)
if %mm%==12 (set month=Dec&goto :EOF)
goto :EOF
:numweek
if %monday% LEQ 0 (goto :EOF)
set /a week+=1
set /a monday-=7
goto :numweek
:kountdays
set /a leapyear=%ficsyyyy%-1
set /a leapyear=%leapyear%-4*(%leapyear%/4)
set /a leapyear=(%leapyear%+1)/4
if %yyyy% GTR %ficsyyyy% (
set /a daysago+=365+%leapyear%
set/a ficsyyyy+=1
goto:kountdays
)
if %mm%==1 (set /a daysago+=0)
if %mm%==2 (set /a daysago+=31)
if %mm%==3 (set /a daysago+=59)
if %mm%==4 (set /a daysago+=90)
if %mm%==5 (set /a daysago+=120)
if %mm%==6 (set /a daysago+=151)
if %mm%==7 (set /a daysago+=181)
if %mm%==8 (set /a daysago+=212)
if %mm%==9 (set /a daysago+=243)
if %mm%==10 (set /a daysago+=273)
if %mm%==11 (set /a daysago+=304)
if %mm%==12 (set /a daysago+=334)
if %mm% geq 3 (set /a daysago+=%leapyear%)
set /a daysago+=%dd%-1
goto:eof
Код: @echo off
setlocal enabledelayedexpansion
set date=%data%
if %date:~0,1%==0 (
set /a dd=%date:~1,1%
) else (
set /a dd=%date:~0,2%
)
if %date:~3,1%==0 (
set /a mm=%date:~4,1%
) else (
set /a mm=%date:~3,2%
)
set /a yyyy=%date:~-4%
set /a ficsyyyy=2007
set /a daysago=0
call:kountdays
set /a daysago=%daysago%-7*(%daysago%/7)
set /a week=1
set /a monday=%dd%-%daysago%
call :numweek
call :nummonth
md "%month%_%week%" 1>nul 2>&1
goto:eof
:nummonth
if %mm%==1 (set month=Jan&goto :EOF)
if %mm%==2 (set month=Feb&goto :EOF)
if %mm%==3 (set month=Mar&goto :EOF)
if %mm%==4 (set month=Apr&goto :EOF)
if %mm%==5 (set month=May&goto :EOF)
if %mm%==6 (set month=Jun&goto :EOF)
if %mm%==7 (set month=Jul&goto :EOF)
if %mm%==8 (set month=Aug&goto :EOF)
if %mm%==9 (set month=Sep&goto :EOF)
if %mm%==10 (set month=Oct&goto :EOF)
if %mm%==11 (set month=Nov&goto :EOF)
if %mm%==12 (set month=Dec&goto :EOF)
goto :EOF
:numweek
if %monday% LEQ 0 (goto :EOF)
set /a week+=1
set /a monday-=7
goto :numweek
:kountdays
set /a leapyear=%ficsyyyy%-1
set /a leapyear=%leapyear%-4*(%leapyear%/4)
set /a leapyear=(%leapyear%+1)/4
if %yyyy% GTR %ficsyyyy% (
set /a daysago+=365+%leapyear%
set/a ficsyyyy+=1
goto:kountdays
)
if %mm%==1 (set /a daysago+=0)
if %mm%==2 (set /a daysago+=31)
if %mm%==3 (set /a daysago+=59)
if %mm%==4 (set /a daysago+=90)
if %mm%==5 (set /a daysago+=120)
if %mm%==6 (set /a daysago+=151)
if %mm%==7 (set /a daysago+=181)
if %mm%==8 (set /a daysago+=212)
if %mm%==9 (set /a daysago+=243)
if %mm%==10 (set /a daysago+=273)
if %mm%==11 (set /a daysago+=304)
if %mm%==12 (set /a daysago+=334)
if %mm% geq 3 (set /a daysago+=%leapyear%)
set /a daysago+=%dd%-1
goto:eof