命令列參數
Bandizip(Bandizip.exe)及其控制台應用程序(bz.exe)支持以下命令列參數:
# Bandizip.exe <command> [<switches>...] <archive> [<files>...] [<path_to_extract>]
# Bandizip.exe <bcommand> [<switches>...] [<files>...]
<archive>檔案
執行“設定”中指定的默認任務。(通常打開存檔。)
<command>指令
a | 添加檔案到壓縮包 |
x | 用完整路徑選取檔案 |
t | 測試檔案的完整性 |
d | 從存檔中刪除檔 |
c | 創建新存檔(用相同名稱覆蓋現有存檔) |
cd | 顯示“新建檔案”對話方塊 |
rn | 重命名存檔中的檔案 |
l | 列出存檔檔案(僅在bz.exe上可用) |
/cmdfile | Read command lines from specified file |
<bcommand> 批處理指令
bc | “使用每個檔案的名稱壓縮多個檔案/資料夾。 如果現有存檔具有相同的名稱,則會創建(存檔名稱)(2)、(存檔名稱)(3)…。如果未指定目標資料夾,則會在每個原始檔案所在的資料夾中創建存檔。” |
bx | “將多個存檔檔案選取到目標資料夾。 如果未指定目標資料夾,則會將檔案解壓縮到每個存檔所在的資料夾。” |
bt | 測試每個歸檔檔案的完整性。 |
<switches>開關
<switches> (僅限 Bandizip)
壓縮且發送電子郵件 | |
-target:dlg | 顯示一個對話方塊,要求指定目標資料夾,並將檔案解壓縮到目標資料夾中的存檔名稱資料夾。 如果使用-o指定了任何資料夾,則該資料夾是對話方塊的默認資料夾。 |
<switches> (僅限bz.exe)
-list:v | 使用命令 l 时,显示文件的详细信息。 |
-list:s | 使用命令 l 時,僅顯示檔名。 |
-consolemode:ansi | 以ANSI格式保存輸出文字txt檔案。 |
-consolemode:utf8 | 以UTF-8格式保存輸出文字txt檔案。 |
示例
開啟檔案
Bandizip.exe sample.zip
新建檔案(覆蓋已有檔案)
Bandizip.exe c c:\sample.zip c:\src\
Bandizip.exe c c:\sample.zip c:\src1\ c:\src2\
添加檔案到壓縮包
Bandizip.exe a c:\sample.zip c:\src\sample.txt
Bandizip.exe a c:\sample.zip c:\src\sample1.txt c:\src\sample2.txt
Bandizip.exe a c:\sample.zip c:\src\*.txt c:\src\*.jpg
從存檔中刪除檔
Bandizip.exe d c:\sample.zip sample.txt
Bandizip.exe d c:\sample.zip *.txt
Bandizip.exe d c:\sample.zip *.tmp *.bak
將檔案解壓縮到目的資料夾
Bandizip.exe x -o:c:\dest\ c:\sample.zip
將檔案添加到存檔,將密碼設定為Passw0rd,在不提示的情况下覆蓋現有檔案,然後關閉對話方塊
Bandizip.exe a -y -p:Passw0rd test.zip c:\src d:\src
將多個存檔檔案解壓縮到一個資料夾
Bandizip.exe bx -o:c:\dst a.zip b.zip c.zip
使用“自動解壓縮”功能將檔案從多個存檔選取到目標資料夾
Bandizip.exe bx -o:c:\dst -target:auto a.zip b.zip c.zip
使用每個資料夾的名稱(a.zip b.zip c.zip)壓縮多個資料夾(a.zip b.zip c.zip)
Bandizip.exe bc a b c
指定存檔的頂級資料夾
Bandizip c -root:top test.zip abc.txt

(bz.exe)創建新存檔
bz c test.zip test

重命名存檔中的檔案
重命名abc.txt為xyz.txt
Bandizip rn test.zip abc.txt xyz.txt
子資料夾內重命名abc.txt為xyz.txt
Bandizip rn test.zip sub/abc.txt sub/xyz.txt

重命名AAA.txt為XXX.txt為BBB.txt為YYY.txt
Bandizip rn test.zip AAA.txt XXX.txt BBB.txt YYY.txt
使用萬用字元選取檔案
在檔名中使用萬用字元來選取檔案或測試存檔
Bandizip x *.zip

Bandizip t ABC??.zip
分別壓縮多個資料夾
使用每個資料夾的名稱壓縮資料夾,並在目標資料夾中創建存檔
Bandizip bc -aoa -o:d:\backup c:\src\folder1 c:\src\folder2 c:\src\folder3
c:\src\folder1 → d:\backup\folder1.zip
c:\src\folder2 → d:\backup\folder2.zip
c:\src\folder3 → d:\backup\folder3.zip
Read and execute command lines from specified file
Save long command lines as TXT file and call it
Bandizip /cmdfile cmdfile.txt
Bandizip /cmdfile c:/test/cmdfile.txt

Spaces in pahts
Use quotation marks when specifying long filenames or paths with spaces
Bandizip t "c:\folder name\file name.zip"
Bandizip x -o:"c:\out folder\" "c:\folder name\file name.zip"
Extract specified files only
Use filenames or wildcards to specify files you want from archive
Bandizip x sample.zip test.txt
Bandizip x sample.zip a.txt b.txt
Bandizip x sample.zip *.jpg
Bandizip x -r sample.zip *.jpg