顯示具有 7-zip 標籤的文章。 顯示所有文章
顯示具有 7-zip 標籤的文章。 顯示所有文章

2019-12-29

簡易 7-zip 命令列指令

因為需要使用 Python 來執行 7-zip 的指令,所以先研究一下如果透過命令列來壓縮和解壓縮。

將某個資料夾裡的所有檔案加入到 test.7z,其中的 a 代表加入檔案,而 -t7z 代表壓縮檔的 type 是 7z。
 7z.exe a -t7z "dirpath\*" 
將 test.7z 解壓縮到指定路徑 outputdir,其中的 e 代表從壓縮檔中提取出來,-o 代表輸出,outputdir 要緊接在 -o 後面。
 7z.exe e test.7z -o"outputdir"