In addition to providing a rich and flexible graphical interface operation, WinZip and WinRAR also have the ability to compress and decompress files from the command-line mode, which makes it very convenient for us to call compression software in batch files. The following are the common command line usage methods for both: [@[email protected]]
Prepare to run the environment
First, prepare WinZip command line run environment http://www.winzip.com/
WinZip graphics operation mode and command line operation mode are separate 2 functions, so to use WinZip command line mode, to download and install WinZip graphics mode software Wzbeta32.exe and WinZip command-line mode software Wzcline.exe, after installation there will be 2 executable files: Wzzip.exe is the command line mode compression execution file, Wzunzip.exe is the command line mode decompression file. To execute them under any command-line mode path, copy the 2 executables to the system directory, such as C:windows.
Second, prepare WinRAR command line running environment http://www.rarsoft.com/
After downloading and installing RAR, in the installation directory will be generated Winrar.exe and Rar.exe,winrar.exe is WinRAR graphical interface program, also as a command line execution program, Rar.exe is a pure command line execution program. Similarly, in order to execute it under any command-line mode path, copy the execution file to the system directory, such as C:windows.
Help information
In the command line state, enter the Wzzip, wzunzip, or rar without parameters to print out the Help information
Examples of commonly used compression and decompression operations
In the following example, we compare the basic compression and decompression operation commands of WinZip and WinRAR. Assume that the compressed package file is named Test.zip and Test.rar.
Task description
Winzip Winrar
Compress the file contents of the catalog test and its subdirectories
Wzzip test.zip Test-r-P
WINRAR A Test.rar Test-r
To delete a *.txt file in a compressed package
Wzzip Test.zip *.txt-d
WinRAR D Test.rar *.txt
Refreshes the files in the compressed package, adding files that already exist in the package but are updated
Wzzip Test.zip test-f
Winrar F Test.rar Test
Update files in a compressed package, add files that already exist in the package but are updated, and new files
Wzzip Test.zip Test-u
Winrar u test.rar Test
Move files to a compressed package, that is, add files to the compressed package and then delete the compressed files
Wzzip Test.zip-r-p-m
Winrar m Test.rar test-r
Add all *.exe files to a compressed file, but exclude files with a or B start name
Wzzip test.zip Test *.exe-xa*.*-xb*.*
WinRAR a Test.rar test *.exe-xa*.*-xb*.*
Add password to compress
Wzzip Test.zip test-s123. Note that passwords are case-sensitive.
WINRAR A Test.rar test-p123-r. Note that passwords are case-sensitive.
Sort the compressed package file by name, in a brief list
Wzzip test.zip-vbn
Rar L Test.rar
Lock the package, which prevents any future modifications to the package
WinZip has no corresponding command
Winrar k Test.rar
To create a 360kb-sized, sub-volume compressed package
WinZip has no corresponding command
Winrar a-v360 Test
Tape directory information Extract file
Wzunzip test.zip-d
Winrar x test.rar-r
Extract files without the catalog information
Wzunzip Test.zip
Winrar e Test
Unzip the file to the specified directory, and if the directory does not exist, automatically creates
Wzunzip Test,zip NewFolder
Winrar x Test.rar NewFolder
Unzip the file and confirm the overwrite file
Wzunzip test.zip-y
Winrar x test.rar-y
Unzip a specific file
Wzunzip Test *.txt
Winrar x Test *.txt
Unzip an update file for an existing file
Wzunzip test.zip-f
Winrar x test.rar-f
Unzip the updated file and new file of the existing file
Wzunzip Test-n
Winrar x test-u
Bulk Unzip files
Wzunzip *.zip
WinRAR e *.rar
WinZip and WinRAR command-line use