WinZip now fully supports the command line method, just need the next WinZip command line support add-on version 1.0 (http://www.winzip.com/wzcline.htm download wzcline.exee.download installation after two files wzzip.exe, wzunzip. EXE, one is compressed, one is decompressed.
Use wzzip.exe to compress the file:
Common Format: wzzip [Options] zipfile [@ listfile] [files...]
[Options] include:
-A default operation: compressing files
-A + compresses the file and deletes the file to be compressed
-B [drive | path] is used to create a temporary compressed file on another drive.
-D. Delete the specified target file in the ZIP file.
-E <X | n | f | S | 0> is used to set the compression ratio. X is the largest and 0 is the smallest.
-F replaces the files in the ZIP file
-H | -? View help
-V: create a list of compressed files
-@ List: first create a file that contains all the files to be decompressed, and then compress the file according to the file name contained.
.............. (For details, refer to the Help File)
[@ Listfile] indicates the list information record of the compressed file.
[Files...] is the multiple files to be compressed, which are separated by spaces or wildcards.
Example:
Compress all files in the current directory
Wzzip test.zip *.*
Compress all TXT files.
Wzzip test.zip *. txt
Compressing two files
Wzzip test.zip abc.txt def.txt
The compressed file contains all TXT files except abc.txt.
Wzzip-xabc. txt test.zip *. txt
Compress all TXT files and subdirectories in D:/docs.
Wzzip-RP test.zip D:/docs/*. txt
Update zipit.1stto test.zip.
Wzzip-u test.zip @ zipit. lst
Lists the contents of a compressed file.
Wzzip-V test.zip
To decompress the file, use wzunzip.exe:
Format: wzunzip [Options] zipfile [@ listfile] [path] [files...]
[Options] include:
-C [m]: Decompress the package to display the file list on the DOS screen.
-D. Recreate the directory structure in the ZIP file.
-F only decompress the files in the ZIP file with the same name as the existing folder.
-Jhrs ignores the hidden, read-only, and system attributes of zip files.
-Jhrs only decompress files with hidden, read-only, and system attributes.
-N: extract only new files. If the files to be extracted are newer than existing ones, replace them.
-O you do not need to use yes to determine whether to replace the file.
-V: create a list of compressed files
-@ List: first create a file that contains all the files to be decompressed, and then decompress the file according to the file name contained.
.............. (For details, refer to the Help File)
For example:
Create all files in the current directory
Wzunzip test.zip
Create abc.txt from test.zipto the current directory
Wzunzip test.zip abc.txt
Create the directory structure and file in test.zip to the current directory
Wzunzip-D test.zip
Create the directory structure and file in test.zip to C:/docs.
Wzunzip-D test.zip C:/docscreate a file containing the file name in files. Ist from test.zip
Wzunzip test.zip @ files. lst
Displays the list of test.zip files.
Wzunzip-V test.zip
Displays the list of all TXT file types in the compressed file.
Wzunzip-V test.zip *. txt
[The above from a Shun's article: http://www.dev-club.com/club/bbs/showEssence.asp? Id = 17712]
To start a process, use the system. Diagnostics. process overload method:
Public static process start (
String filename,
String arguments
);
Remember to close the process in time (kill method)
Ii. Usage of WinRAR
This section describes how to use command lines in WinRAR to compress and decompress files.
Compression: WinRAR A [-Switches] [files] [@ file lists]
For example, if you want to compress try. mdb to a drive C, you can use WinRAR a c:/try.rar C:/try. MDB.
Decompress: If the directory contains
WinRAR X [-Switches] [files] [@ file lists] [destionation Folder/]
If the current directory is decompressed, that is, the directory name is not written during decompression.
WinRAR E [-Switches] [files] [@ file lists] [destionation Folder/]
For example, if you want to extract try.rar to drive C, you can use WinRAR x C:/try.rar C:/try. MDB.
From http://search.csdn.net/Expert/topic/2034/2034425.xml? Temp =. 3689539.