a guest Jun 20th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- @echo on D: cd D:ExeVBS color 0b set day=-1 echo >"%temp%%~n0.vbs" s=DateAdd("d",%day%,now) : d=weekday(s) echo>>"%temp%%~n0.vbs" WScript.Echo year(s)^& right(100+month(s),2)^& right(100+day(s),2) for /f %%a in ('cscript /nologo "%temp%%~n0.vbs"') do set "result=%%a" del "%temp%%~n0.vbs" set "YYYY=%result:~0,4%" set "MM=%result:~4,2%" set "DD=%result:~6,2%" set "date-yesterday=%yyyy%-%mm%-%dd%" echo Yesterday was "%date-yesterday%" Required result Fri2019-05-17
RAW Paste Data