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 Unzip Files in Windows Using CMD and PowerShell

Unzipping files is a common task that users need to perform to access the contents of compressed files. In the Windows environment, this can be done using built-in tools such as Command Prompt (CMD) and PowerShell. This article will guide you through the steps to unzip files using both CMD and PowerShell.

Unzipping Files Using CMD

Windows has a built-in utility called tar that can be used to unzip files from the command line. Here’s how you can do it:

  1. Open Command Prompt:

    • Press Win + R, type cmd, and press Enter.
  2. Navigate to the Directory:

    • Use the cd command to navigate to the directory where your zip file is located.
      cd path\to\your\directory
  3. Unzip the File:

    • Use the tar command to unzip the file.
      tar -xf yourfile.zip

Unzipping Files Using PowerShell

PowerShell provides more advanced capabilities for unzipping files. Here’s how you can do it:

  1. Open PowerShell:

    • Press Win + X, select Windows PowerShell.
  2. Navigate to the Directory:

    • Use the Set-Location cmdlet to navigate to the directory where your zip file is located.
      Set-Location -Path "path\to\your\directory"
  3. Unzip the File:

    • Use the Expand-Archive cmdlet to unzip the file.
      Expand-Archive -Path yourfile.zip -DestinationPath .\unzipped
    • The -DestinationPath parameter specifies the folder where the contents will be extracted. In this example, it will create a folder named unzipped in the current directory.

Practical Examples

Example 1: Unzipping a File Using CMD

Suppose you have a file named example.zip in the C:\Downloads directory. Here’s how you can unzip it:

  1. Open Command Prompt:

    cmd
  2. Navigate to the Directory:

    cd C:\Downloads
  3. Unzip the File:

    tar -xf example.zip

Example 2: Unzipping a File Using PowerShell

Suppose you have a file named example.zip in the C:\Downloads directory. Here’s how you can unzip it:

  1. Open PowerShell:

    powershell
  2. Navigate to the Directory:

    Set-Location -Path "C:\Downloads"
  3. Unzip the File:

    Expand-Archive -Path example.zip -DestinationPath .\example_unzipped

Conclusion

Unzipping files in Windows can be efficiently done using either Command Prompt or PowerShell. Both methods offer straightforward commands to extract the contents of a zip file. Whether you prefer using CMD or PowerShell, you now have the knowledge to unzip files quickly and easily.

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.