|
|
楼主 |
发表于 2017-11-4 14:29:27
|
显示全部楼层
@echo off
PowerShell -c "gwmi Win32_QuickFixEngineering | Sort InstalledOn -Des | ForEach{+$_.InstalledOn.ToString('yyyyMMdd')}" > a.txt
set /p num= < a.txt
del a.txt
set num2=%date:~,10%
set num2=%date:/=%
set y=%num:~,4%
set m=%num:~4,2%
set d=%num:~6,2%
set a=dateserial(%y%,%m%,%d%)
set y2=%num2:~,4%
set m2=%num2:~4,2%
set d2=%num2:~6,2%
set b=dateserial(%y2%,%m2%,%d2%)
echo wscript.echo datediff("d",%a%,%b%)>t.vbs
for /f %%r in ('cscript /nologo t.vbs') do echo %%r
del t.vbs
pause |
|