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 Use the COMPACT Command in Windows to Save Disk Space

The COMPACT command is a built-in utility in Windows that allows users to compress and decompress files and directories on NTFS file systems. This can help save disk space without the need to archive files into ZIP or RAR formats. The command is executed via the Command Prompt (CMD) and is especially useful for managing storage on systems with limited disk space.

Examples:

  1. View Compression Status: To check the compression status of files and directories in a specific folder, use the following command:

    compact /c C:\YourFolder

    This will display each file and directory's compression status within "C:\YourFolder".

  2. Compress a Directory: To compress all files in a directory, use:

    compact /c /s:C:\YourFolder

    The /c switch specifies compression, and /s applies the command to all subdirectories within "C:\YourFolder".

  3. Compress a Specific File: If you want to compress a specific file, use the command:

    compact /c C:\YourFolder\YourFile.txt
  4. Decompress a Directory: To decompress files in a directory, use:

    compact /u /s:C:\YourFolder

    The /u switch specifies decompression.

  5. Decompress a Specific File: To decompress a specific file, use:

    compact /u C:\YourFolder\YourFile.txt
  6. Force Compression or Decompression: If you encounter files that are already compressed or decompressed and want to ensure the command is applied, use the /f switch:

    compact /c /f C:\YourFolder
  7. Display Help Information: To see all available options and usage information for the COMPACT command, enter:

    compact /?

Notes:

  • The COMPACT command only works on NTFS file systems.
  • Compressing files can save disk space, but it may also impact performance, especially for frequently accessed files.
  • Use the command judiciously, especially on system or program files, to avoid potential issues.

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.