CMD 结合rar进行文件打包
程序员文章站
2024-03-14 17:35:58
...
CMD 结合rar进行打包
- 程序备份-自动增加版本号
echo off
color 0a
title 程序备份-自动增加版本号
@echo off
set fdate=%date:~0,4%%date:~5,2%%date:~8,2%
for /f "tokens=1,2 delims=:" %%i in ('time/t') do set t=%%i%%j
set ftime=%t:~0,4%%time:~6,2%
set preName=XXX_NORefund_
:Loop
set /a Num+=1
if exist "%preName%%fdate%_%Num%.rar" goto Loop
::set fname=%fdate%_%Num%
::set fname=XXX_X_%fdate%_%ftime%
set fname=%preName%%fdate%_%Num%
echo 程序名称:%fname%
pause
"C:\Program Files\WinRAR\WinRAR.exe" a -r -s -m1 ./%fname%.rar ./file1/* ^
./file2/* ^
./record.txt