@echo off
setlocal enabledelayedexpansio
::7z的路径和编译参数
set z7="C:\\Program Files\\7-Zip\\7z.exe"
set flag=-mx=9 -ms=on -myx=9 -mqs=on -mmt=on -mhc=on -mhcf=on -m0=LZMA2:a=2:d=64m:fb=128:mf=bt4 -mf=BCJ2 -mlc=4 -mmc=256
::压缩包文件名
set filename=
::替换0~9点时的数字前空格为零
set hh=%time:~0,2%
if /i %hh% LSS 10 (set hh=0%time:~1,1%)
::年月日,时,分
set fndata="%date:~,4%%date:~5,2%%date:~8,2%%hh%%time:~3,2%"
%z7% a -t7z %flag% %filename%%fndata%.7z (被压缩文件名)
setlocal enabledelayedexpansio
::7z的路径和编译参数
set z7="C:\\Program Files\\7-Zip\\7z.exe"
set flag=-mx=9 -ms=on -myx=9 -mqs=on -mmt=on -mhc=on -mhcf=on -m0=LZMA2:a=2:d=64m:fb=128:mf=bt4 -mf=BCJ2 -mlc=4 -mmc=256
::压缩包文件名
set filename=
::替换0~9点时的数字前空格为零
set hh=%time:~0,2%
if /i %hh% LSS 10 (set hh=0%time:~1,1%)
::年月日,时,分
set fndata="%date:~,4%%date:~5,2%%date:~8,2%%hh%%time:~3,2%"
%z7% a -t7z %flag% %filename%%fndata%.7z (被压缩文件名)