China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 09:15
中国DOS联盟论坛 » DOS软件下载 & 游戏分享 (下载室) » How to Use Common Compression and Extraction Tools under DOS (Original) View 2,422 Replies 1
Original Poster Posted 2002-11-16 00:00 ·  美国 肯塔基州 费耶特县 列克星敦 Charter_Communications
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Using common compression and extraction tools under DOS

As everyone knows, in order to preserve files and save space, files are often compressed. Also, since after a file is compressed it usually becomes just one archive file, it is easier to carry around, and it can also be password-protected, so compressing and extracting files has become an operation everyone often uses, as can be seen in this site's "DOS Usage" section. So how are these operations carried out? Below is an introduction to methods of compression/extraction under DOS.

Because compression software differs, there are several kinds of archive files as well. The most common archive formats are ZIP, RAR, ARJ, and so on. ZIP format in particular is used most widely, and most of the software on this site is in this format. Under DOS there are many tools for compressing these ZIP files, such as PKZIP, InfoZIP, etc. Among them, the most famous and most practical are the PKZIP/PKUNZIP tools. Their latest version is 2.50, which can be downloaded from this site's "compression software" section. Run the self-extracting file in it, and then it can be used directly without installation. Some people have used tools such as WinZip and WinRAR; from installation to use, a whole series of steps is usually needed to complete one operation. PKZIP/PKUNZIP is quite different: it inherits DOS's convenient and practical characteristics, and is very easy to use. Usually a single command can complete the corresponding ZIP operation, making it fast and efficient. Moreover, PKZIP/PKUNZIP 2.50 is also very powerful: not only are its operations very comprehensive, it also fully supports file lists and long filenames. The usage and commonly used command-line parameters of PKZIP/PKUNZIP are listed below:

PKZIP ZIP filename

Among them, the commonly used options are (not case-sensitive):

-a Add files to the archive.
-d Delete files from the archive.
-f Freshen files in the archive.
-u Update files in the archive.
-p Store the relative paths of the files being compressed.
-r Remember the path structure of the files being compressed.
-s Set the archive password.
-v View the contents of the archive.
-x Exclude specified files when compressing.
-z Add or modify the archive comment.
For example: PKZIP -A -S:FILE BMPS.ZIP D:\*.BMP. This command compresses all files under D:\ with the extension BMP and adds them to the file BMPS.ZIP, and sets the compression password to "FILE".

If no option is specified, then files are automatically added/updated in the ZIP archive; if no filename to compress is specified, then by default all files in the current folder are operated on. For example: PKZIP FILES.ZIP will compress all files in the current folder and add them to FILES.ZIP.

PKUNZIP ZIP filename

Among them, the commonly used options are (not case-sensitive):

-d Restore the path structure stored in the archive.
-e Extract files from the archive.
-f Freshen the extracted files.
-o If the file already exists, overwrite it directly when extracting.
-s Enter the archive password in order to extract.
-t Test the integrity of the archive.
-v View the contents of the archive.
-x Exclude specified files when extracting.

For example: PKUNZIP -D -S:FILE BMPS.ZIP *.BMP will extract all files with the extension BMP from the file BMPS.ZIP, preserve the original file paths, and use the password "FILE" that was set at the time for extraction.

If no option is specified, then files are automatically extracted from the ZIP archive; if no filename to extract is specified, then by default all files in the archive folder are operated on. For example: PKUNZIP FILES.ZIP will extract all files in FILES.ZIP.

As can be seen, the operations of PKZIP and PKUNZIP above are very similar (however, PKUNZIP fully supports wildcards, while in PKZIP the specified ZIP archive filename cannot be a wildcard), but the results are exactly the opposite. Because they are very simple and practical to use, after using them for a little while everyone will find them very easy to operate.

In addition, PKZIP also comes with tools such as PKZIPFIX, which can perform operations such as repairing ZIP files.

For files in RAR format, RAR 3.0 can be used for compression and extraction. It fully supports long filenames and the latest RAR file compression method (unlike RAR 2.50, which does not support it), and it can also be downloaded from this site's "compression software" section. The command-line operating method of RAR 3.0 is listed below:

RAR RAR filename

Among them, the commonly used commands are:

a Add files to the archive.
c Add an archive comment.
e Extract files in the archive to the current folder.
f Freshen files in the archive.
l List the contents of the archive.
t Test the integrity of the archive.
r Repair a damaged archive.
x Extract files in the archive to the folders stored in the archive.

The commonly used options are:

-m Set the compression level, from 0 to 5.
-p Set or enter the archive password.
-r Remember the path structure of the files being compressed.
-u Update files in the archive.

Since its operating method is very similar to the ZIP file operations above, no example will be given here.

As for ARJ archive files, its operation is almost exactly the same as RAR above, and you can refer to RAR's commands and options. There are also some other archive formats, such as TAR, GZIP, ARC, ACE, and so on. Their compression/extraction and other operations can likewise be completed with the corresponding tools (such as UNTAR, UNARC, UNACE, etc.).

The above is the usage of common compression tools under DOS. Everyone can use them to carry out various compression/extraction operations.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 2 Posted 2002-11-26 00:00 ·  中国 广东 东莞 电信
中级用户
★★
Credits 493
Posts 161
Joined 2002-10-29 00:00
23-year member
UID 94
Gender Male
From ZHCN
Status Offline
I still find RAR more usable. Under DOS it's a bit stronger than ARJ (compression and interface), and under WIN it's done a bit better than WZIP, at least it's more generous than WZIP. WZIP80 still doesn't support WRAR format.
Forum Jump: