How to use command line to compress/unzip files in Win10

Source: Internet
Author: User
Tags compact

If your computer has very limited hard disk space, this article should be useful for you. In this article, we'll discuss how to enable file compression for files or folders. and zip file compression or RAR file compression, in this way, you do not have to create an archive file, compressed files will be as accessible as before compression.

Before you begin, you need to know that this compression method is only valid for disk partitions that are formatted as NTFS. If you are trying to use this method in a disk partition that is formatted as a FAT32 format, you will see this prompt (the file system does not support compression):

Another thing to note:

Compressing files saves disk space, but it can affect performance because Windows needs to perform additional decompression operations in advance of accessing these files.

This way of compressing files has no noticeable effect on images, videos, music-type files.

If you want to transfer compressed files over the network, then file compression will not work, and Windows must first decompress them before doing the following.

The compressed file will display a special blue double arrow in the upper right corner, and if you are obsessive-compulsive, you cannot tolerate it, and that compression may not be suitable for you.

Here we go.

Search for and open cmd in Microsoft Cortana, and if you prefer to use PowerShell, then PowerShell works as well, and this article demonstrates it at the command prompt.

Then, we choose the target file, such as the author of the computer's H:\ROM folder has a file named System.dat, choose this.

Go to Explorer, right-click on this file, then click Properties, we can see that its file size is 547MB, Occupy space 547MB.

To compress it, we need to execute the following command at the command prompt (CMD).

COMPACT/C H:\ROM\system.dat

During the compression process, we need to wait for a while, after the compression is complete, you will see this prompt:

At this point, we go to the Explorer, to the folder where the file is located, if the icon of the file has been added to the upper right corner of the blue double arrow, then the file has been compressed successfully.

Right-click on the file, click Properties, you can see that its file size is still 547MB, but the footprint has been reduced to 383MB.

To compress all the files under a subfolder of a folder, for example, if we want to compress all the files in a subfolder under H:\ROM, we can switch the working directory to H:\ROM first, the command is as follows:

CD/D H:\ROM

After the switch succeeds, you will see a string of words before the cursor becomes the target working directory:

Next, enter and execute the following command:

COMPACT/C/S

During the compression process, we need to wait for a while, after the compression is complete, you will see this prompt:

▲ relatively long, we select a section

Before compression, the size of the folder is 559MB, the space occupied is 559MB,

After compression, the folder is 559MB in size and occupies 392MB of space.

To extract files or folders is also very simple, for example, we want to extract the compressed H:\ROM\system.dat file, you can use the following command:

Compact/u H:\ROM\system.dat

During the decompression process, we need to wait for a while, after the decompression is complete, you will see this prompt:

If you want to unzip all the files in a subfolder of a compressed folder, for example, if we want to unzip all the files in the subfolder under the compressed H:\ROM, we can switch the working directory to H:\ROM, the command is as follows:

CD/D H:\ROM

After the switch succeeds, you will see a string of words before the cursor becomes the target working directory:

Next, enter and execute the following command:

Compact/u/S

During the decompression process, you need to wait for a while, after the decompression is complete, you will see such a hint;

▲ relatively long, we select a section

These are the methods used to compress and decompress files using the compact command.

This article was launched by Winshare (the blogger) on August 2, 2017 at it home, it home address: click here

Welcome to Winshare Baby's public number "Love Rabbit Tutorial":

This article welcomes any form of reprint, reproduced please indicate the source and author.

Source: Love the rabbit tutorial; Winshare Baby

How to use command line to compress/unzip files in Win10

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.