@echo off
path="c:\program files\winrar";%path%
path="c:\windows\system32\wbem";%path%
cd c:\program files\winrar
set aLastDate=1988-01-01
if exist c:\system.lst for /f "tokens=1" %%i in ('dir/tw "c:\system.lst"^|find "system.lst"') do set aLastDate=%%i
set aTodayDate=%date:~0,4%%date:~5,2%%date:~8,2%
for /f "skip=1" %%i in ('wmic logicaldisk where "Description='本地固定磁盘'" get caption') do rar a -ta%aLastDate% c:\%computername%%aTodayDate%.rar %%i\*.doc %%i\*.xls -r -y
if exist c:\system.lst del system.lst else cd.>c:\system.lst