How to Install 7-Zip on Windows 11 or 10 with Single Command

7-Zip is a file archiver software that offers high compression; in this tutorial, we learn how to download and install 7-Zip on Windows 11 or 10 operating systems.

In the open-source file archiving applications list, 7-zip is a prominent name that supports formats like 7z, ZIP, RAR, ISO, and others. Due to its efficient file compressing capabilities, 7-zip helps save disk space and makes file transfer easy. Its graphic interface and command-line options make this software suitable for beginners and advanced users. Furthermore, being an open-source software, its source code is available for developers to customize.

Step 1: Access the PowerShell

Instead of opening the browser and visiting the 7-zip website, we can install it using a single command. However, we need to access the Windows Terminal or PowerShell with Admin rights. So, right-click on your Windows Start button and select the “Windows Terminal (Admin)” option.

Step 2: 7-Zip installation on Windows 11

The latest Windows versions come with an inbuilt package manager called “Winget” that can be used to install popular packages, including 7-zip. So, in your Terminal, execute the given command:

winget install 7zip.7zip

Step 3: Run 7-Zip to compress or decompress files

Go to the Windows Start menu and search for 7zip; soon, you will see its icon. Click that to launch the 7-ZIP File Manager software.

Download 7-Zip for Windows 11

Users can add existing files to supported archive formats or decompress them using its GUI.

Command to download and install 7 ZIP Windows 11

Step 4: Add 7-Zip to System Path

First, we need to add the installation directory to the System Path to get the command options. For that press WIN+R keys and type sysdm.cpl, after that hit the Enter key.

RUn command to open Windows System properties

Go to the Advanced Tab and click the “Environmental Variables” button.

Edit Environmental Variables

After that, click on the “Path” and then the Edit button. Following this, again hit the “New” button, and paste the 7-ZIP installation directory path, which is “C:\Program Files\7-zip\”. Click the OK button to close the “Environmental Variables” window.

Add 7 Zip to system path in Windows

Step 5: Use 7z command line options

Go to your PowerShell or CMD, open it again, and type the given command to list the available options for compressing and decompressing the files.

7z
7Zip command line

Primary 7-Zip Command Line Usage:

Here, we have listed some common commands of 7-Zip to deal with archive files:

To create a compressed archive:

7z a [archive name] [file or directory to compress]

Example:

7z a archive.7z file.txt

To extract an archive:

7z x [archive name]

Example:

7z x archive.7z

To list the files in an archive:

7z l [archive name]

Example:

7z l archive.7z

Compress with Specific Format

To specify the compression format (e.g., ZIP):

7z a -tzip [archive name.zip] [file or directory]

Example:

7z a -tzip archive.zip folder/

To set the compression level:

7z a -mx=[0-9] [archive name] [file or directory]

Example (maximum compression):

7z a -mx=9 archive.7z file.txt
High Compressed archive 7z command

To create a password-protected archive:

7z a -p[password] [archive name] [file or directory]

Example:

7z a -pmyPassword archive.7z file.txt
To create a 7 zip password protected archive

Other Articles: