How to Zip Files Using Command Prompt

March 11, 2024 / Web Hosting

In this article, you will explore how to zip files using command prompt. You can zip files through Command Prompt using the tar command. A command line tool helps you to extract files and create archives. However, this command only works in Windows 10 or later.

Here are the steps to be followed-

  1. Press the Win key to open the Start Menu.
  2. In the search bar, type Command Prompt, and select “Run as administrator” from the right pane.
  3. In the console, type the following command and press Enter, replacing “Place” with the file’s location.
    cd Place
  1. Enter “dir” and press Enter to display the files within the chosen folder.
  2. To compress all files within the selected folder, input the following command and press Enter. Replace “Compressed” with your desired folder name for the zip file storage. Additionally, replace “FileExt” with the file extension you are compressing.
    tar -a -c -f Compressed.zip *.FileExt
  1. To compress a single file, use the following command. Replace ‘Compressed’ with your desired folder name for the zip file storage, ‘FileExt’ with your file’s extension, and ‘FileName’ with the name of the file you want to compress.
    tar -a -c -f Compressed.zip FileName.FileExt

In such a manner, you can Zip Files Using Command Prompt. Hope you liked our article. For latest KBs, visit our KB section regularly.

 

Spread the love