In Management Server It is often the basis of a day to infer the load date system log files, for example, the need to upload logs on Friday, Monday. Date the log file was named the day before the log was uploaded. This takes the first three days to get the date. or before n the date of the day.
Bulk-bound VBS can be implemented, such as the following files.
If "%date:~13%" = = "One" (set daysago=3) Else (set daysago=1) > "%temp%\mydate.vbs" Echo lastdate=date ()-%daysago%> > "%temp%\mydate.vbs" Echo fmtdate=right (Year (lastdate), 4) ^& right ("0" ^& month (lastdate), 2) ^& right (" 0 "^& Day (Lastdate), 2) >>"%temp%\mydate.vbs "Echo WScript.Echo fmtdatefor/f%%a in (' Cscript/nologo '%temp%\my Date.vbs "') do (set dstdate=%%a) set Dstdate=%dstdate:~0,4%-%dstdate:~4,2%-%dstdate:~6,2%echo%DstDate%
Assume that the WIN8 system is able to change if "%date:~13%" to If "%date:~12%"
Set dstdate=%dstdate:~0,4%-%dstdate:~4,2%-%dstdate:~6,2%
Set the date grid formula for this thing
Copyright notice: This article Bo Master original article. Blog, not reproduced without consent.
Use batch bat as the first three days of a date system date