Are files too large to transfer? Not enough disk space? Regardless of the reasons, creating zip files is common in computer use. This MiniTool post will show you how to create zip files using Command Prompt and give several ways to unzip files. Let’s keep reading.
Command Prompt is officially called the Windows Command Processor, short for CMD. It is the command line interface for Windows operating systems. You can perform various command lines via this tool to fix problems or complete operations.How to open Command Prompt- Press Win + S, type Command Prompt into the search bar, and hit Enter to open it.
- Press Win + R, type cmd into the text box, and hit Enter to open it.
How to Create Files Using Command Prompt
Command lines are widely used to resolve many computer errors. You can also zip files with Command Prompt by using the tar command line. Please follow the next steps to learn how to do it.Step 1: Press Win + R to open the Run window.Step 2: Type cmd into the text box and press Shift + Ctrl + Enter simultaneously to run Command Prompt as administrator.Step 3: Type the command line: cd Location and hit Enter.Please replace Location with the specific location of the folder you want to zip up.Step 4: Type dir and hit Enter. Then the files included in the selected folder will display in the interface.Step 5: Type the command line: tar -a -c -f Compressed.zip *.FileExt and hit Enter.If you want to compress all the files in the folder, please replace Compressed with the name of the zip folder and change FileExt to the extension(s) of the file you’re going to compress.Tips:
If there are different types of files, you can add more *.FileExt at the end of the command line. For example, tar -a -c -f Pictures.zip *.png *.docm.
How to Zip Files Using Other Methods
In addition to creating a zip file using Command Prompt, there are many other methods to help you zip files.Method 1: Zip files by Send toStep 1: Right-click on the folder you want to compress.Step 2: Choose Send to > Compressed (zipped) folder.The new zip folder will be created under the same name and the same location.Method 2: Compress files with File ExplorerStep 1: Locate the folder you want to zip in File Explorer.Step 2: Shift to the Share tab on the toolbar.Step 3: Choose Zip to compress the folder.You can change the name of the created zip folder directly.How to Unzip Files
If you want to extract files from a zip folder, you can also use Command Prompt to make it.Step 1: Press Win + S and type Command Prompt into the search bar.Step 2: Choose Run as administrator from the right panel.Step 3: Type cd Location and hit Enter.Please replace Location with the specific path of the file.Step 4: Type tar -xf Name.zip and hit Enter. Change Name to the name of the zip folder.Then, you can find the uncompressed files in the same folder.Bottom Line
You will face various situations that need to zip files. You can try to create zip files using Command Prompt if you don’t want to install third-party tools.If you delete files accidentally in the process of zipping files, you can try MiniTool Power Data Recovery to restore them.MiniTool Power Data Recovery FreeClick to Download100%Clean & Safe
This free data recovery tool allows you to rescue various types of files like photos, videos, archives, documents, etc. You can also recover files from external hard drives, SD cards, memory cards, and so on. You can use the free edition to recover up to 1GB of files. If needed, you can get the full edition to obtain unlimited data recovery capacity.