Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Compress Files and Folders in Windows Using Built-in Tools and CMD

Compressing files and folders is a crucial task for saving disk space and facilitating easier file transfer. Windows provides several built-in tools and command-line options to perform compression. This article will guide you through the process of compressing files and folders using Windows Explorer, Command Prompt (CMD), and PowerShell.

Using Windows Explorer

Windows Explorer offers a straightforward way to compress files and folders into a ZIP archive.

  1. Select Files/Folders: Navigate to the files or folders you want to compress.
  2. Right-click: Right-click on the selected items.
  3. Send to: Hover over the "Send to" option.
  4. Compressed (zipped) folder: Click on "Compressed (zipped) folder".

This will create a ZIP file in the same directory with the same name as the selected item(s).

Using Command Prompt (CMD)

You can also compress files and folders using the compact command in CMD. This command is primarily used for NTFS compression.

  1. Open CMD: Press Win + R, type cmd, and press Enter.
  2. Navigate to Directory: Use the cd command to navigate to the directory containing the files/folders you want to compress.
    cd C:\path\to\your\directory
  3. Compress Files/Folders: Use the compact command to compress the items.
    compact /c /s:your_folder_name

Using PowerShell

PowerShell provides more flexibility and features for file compression.

  1. Open PowerShell: Press Win + X, then select "Windows PowerShell".
  2. Compress Files/Folders: Use the Compress-Archive cmdlet to compress files and folders.
    Compress-Archive -Path C:\path\to\your\directory -DestinationPath C:\path\to\your\archive.zip

Examples

Example 1: Compressing a Folder Using CMD

  1. Open Command Prompt.
  2. Navigate to the directory containing the folder.
    cd C:\Users\YourUsername\Documents
  3. Compress the folder named "Project".
    compact /c /s:Project

Example 2: Compressing Files Using PowerShell

  1. Open PowerShell.
  2. Compress the files in a directory into a ZIP archive.
    Compress-Archive -Path C:\Users\YourUsername\Documents\Project -DestinationPath C:\Users\YourUsername\Documents\Project.zip

Conclusion

Windows offers multiple methods for compressing files and folders, whether you prefer using the graphical interface, Command Prompt, or PowerShell. Each method has its advantages and can be chosen based on your specific needs.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.