如题所述
@echo off
set "des=A"
set "src=B"
mkdir D:\backup%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%\
forfiles /p %des% /s /d -7 /c "cmd /c copy /y @file D:\backup%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%"
"c:\Program Files\WinRAR\WinRAR.exe" a /ibck /m5 %src%backup%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%.rar D:\backup%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%
del /q /s D:\backup%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%
forfiles /p %des% /s /d -7 /c "cmd /c del /q @file
这里面N为7,自己改下
set "des=A"
set "src=B"
mkdir D:\backup%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%\
forfiles /p %des% /s /d -7 /c "cmd /c copy /y @file D:\backup%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%"
"c:\Program Files\WinRAR\WinRAR.exe" a /ibck /m5 %src%backup%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%.rar D:\backup%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%
del /q /s D:\backup%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%
forfiles /p %des% /s /d -7 /c "cmd /c del /q @file
这里面N为7,自己改下
温馨提示:答案为网友推荐,仅供参考