Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 67,789 of 68,980    |
|    mokomoji to All    |
|    Re: Get date of recent weekday    |
|    07 Sep 21 11:19:16    |
      From: mokomoji@naver.com              @echo off       setlocal       cd /d %~dp0       set "z_day1=mon" ::1       set "z_day2=tue" ::2       set "z_day3=wed" ::3       set "z_day4=thu" ::4       set "z_day5=fri" ::0       set "z_day6=sat" ::1       set "z_day7=sun" ::2              for /f "tokens=1* delims==" %%f in (       'wmic path win32_localtime get dayofweek /value'       ) do (       if "%%~g" neq "" (       call set "z_toweek=%%%%%!%z_day%%~g%!%%%%%"       call set z_dayx=%%g       call set /a "z_value1=(%%z_dayx%% %%%%5)"       call set /a "z_value2=!(%%z_dayx%%/5)*2"       call set /a "z_value3=%%z_value1%%+%%z_value2%%       ))       echo Monthly do not with       echo Leap years do not with       call echo today "%z_toweek%" "%date:~-2%" day -"%z_value3%" day = last friday              forfiles /d -%z_value3% /c "cmd /c echo @file"              pause       endlocal                     w.t.perfect~!!!              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca