[备份策略]批处理压缩指定目录文件

1、批处理压缩目标下所有文件为7z

echo on

for /r %%F in (*) do (echo “%%~nF” && “C:\Program Files\7-Zip\7z.exe” a -t7z -mx=9 -ppassword “%%~dpnF.7z” “%%F” )

2、压缩指定文件为zip格式

“C:\Program Files\7-Zip\7z.exe” a -tzip -mx=9 -ppassword 20200112_090851.zip 20200112_090851.m4a

参考:
https://blog.csdn.net/u012995964/article/details/91975762