Windows does not include a built-in unzip command like Linux or macOS, but you can extract ZIP files from the command line using PowerShell or third-party tools like 7-Zip. This guide shows how to do it reliably using only built-in Windows tools (PowerShell) and, as a fallback, a free, widely trusted open-source tool (7-Zip). No extra software is required if you use PowerShell, which is installed by default on all modern Windows 10 and 11 systems.
What You'll Need
- A Windows 10 or Windows 11 computer (PowerShell 3.0+ is included by default)
- The ZIP file you want to extract (e.g.,
archive.zip) - A target folder where you want the contents extracted (optional but recommended)
Step-by-Step
- Open PowerShell as Administrator (optional but avoids permission issues in protected folders):
- Press
Win + S, typepowershell, right-click Windows PowerShell, and choose Run as administrator. - Click Yes on the User Account Control prompt if it appears.
- Press
- Navigate to the folder containing your ZIP file using
cd:- Example:
cd C:\Users\YourName\Downloads - Use
dirto list files and confirm your ZIP file (e.g.,archive.zip) is present.
- Example:
- Run the extraction command with the built-in .NET
Expand-Archivecmdlet:- Basic syntax:
Expand-Archive -Path "archive.zip" -DestinationPath "C:\target\folder" - Replace
archive.zipwith your exact filename (include quotes if the path has spaces). - Replace
C:\target\folderwith the full path to where you want files extracted (e.g.,"C:\ExtractedFiles"). - Example:
Expand-Archive -Path "C:\Users\YourName\Downloads\backup.zip" -DestinationPath "C:\Users\YourName\Desktop\backup"
- Basic syntax:
- Press
Enterto execute. No progress bar appears by default—wait for the prompt to return (usually seconds unless the ZIP is large). - Verify extraction:
- Open File Explorer to your destination folder and confirm files are present.
- Or run
dirin PowerShell in the destination folder to list contents.
Common Mistakes
- Missing quotes around paths with spaces:
C:\My Files\archive.zipfails unless quoted as"C:\My Files\archive.zip". - Typo in filename: PowerShell throws
FileNotFound. Double-check the exact name (case-insensitive, but spelling must match). - Destination folder doesn’t exist:
Expand-Archivewill create the folder automatically *if* the parent path exists (e.g.,C:\NewFolderworks ifC:\exists), but avoid nested paths likeC:\A\B\CunlessAandBexist. - Running in Command Prompt (cmd.exe) instead of PowerShell: The
unzipcommand does not exist incmd.exe. Ensure you’re in PowerShell (look forPS C:\>at the prompt). - Overwriting without warning:
Expand-Archivereplaces existing files silently. Use the-Forceparameter only if you intend to overwrite, but be aware it’s not needed for initial extraction.
Tips
- Use
-Verbosefor details: Add-Verboseto see each file being extracted:Expand-Archive -Path "archive.zip" -DestinationPath "C:\out" -Verbose. - Create destination folder first: Run
New-Item -ItemType Directory -Path "C:\Extracted"to ensure the folder exists and avoid issues. - Extract to current directory: Use
-DestinationPath "."to extract into the current folder (e.g.,cd C:\temp; Expand-Archive -Path "data.zip" -DestinationPath "."). - Check ZIP integrity first: Run
Test-Archive "archive.zip"(PowerShell 6.0+ on newer Windows 11) or open the ZIP in File Explorer to verify it’s not corrupted before extracting. - Large files? Use
-Updatecarefully:-Updateonly extracts newer files, but it’s slower. For full control, extract to a new folder each time.
Troubleshooting
- Error: "The filename, directory name, or volume label syntax is incorrect"
- Check for invisible characters (e.g., smart quotes from copied text). Type the path manually instead of pasting.
- Ensure backslashes are
\(double backslash) or use forward slashes/(PowerShell accepts both).
- Error: "The archive header is corrupted" or "Data is invalid"
- The ZIP file is likely corrupted. Re-download or re-create it.
- Try extracting with 7-Zip (free): Install 7-Zip, then run
& "C:\Program Files\7-Zip\7z.exe" x "archive.zip" -o"C:\target".
- Permission denied when extracting to system folders (e.g.,
C:\Program Files)- Run PowerShell as Administrator (Step 1 above).
- Or extract to your user folder (e.g.,
\Desktopor\Documents).
- Command runs but no files appear
- Verify the destination path exists:
Test-Path "C:\target"returnsTrueorFalse. - Check for nested folders: Some ZIPs create a top-level folder (e.g.,
archive/), so look inside subfolders.
- Verify the destination path exists:
- Still stuck? Try the GUI fallback
- Right-click the ZIP file > Extract All... > follow prompts.
- Or drag the ZIP into File Explorer and use Extract All from the ribbon.
Frequently Asked Questions
Does Windows have a native unzip command like Linux?
No—Windows does not include a command-line tool named unzip. However, PowerShell’s Expand-Archive cmdlet performs the same function reliably using built-in APIs.
Can I use unzip in Command Prompt (cmd.exe)?
Not natively. cmd.exe lacks built-in ZIP support. You must use PowerShell or install third-party tools like 7-Zip or WinRAR (which add 7z or unrar commands).
How do I extract a password-protected ZIP file via command line?
PowerShell’sExpand-Archive does not support passwords. Use 7-Zip: install it, then run & "C:\Program Files\7-Zip\7z.exe" x -p"yourpassword" "archive.zip" -o"C:\target". Replace yourpassword with the actual password.
What if my ZIP file is larger than 4 GB?
PowerShell handles large ZIPs (up to 4 GB per file inside) without issues. For ZIPs exceeding 4 GB total, ensure your destination drive uses NTFS (FAT32 has a 4 GB file-size limit).Expand-Archive works as long as the extracted content fits the drive’s format.
Can I extract multiple ZIP files at once?
Yes—use a loop in PowerShell:Get-ChildItem *.zip | ForEach-Object { Expand-Archive -Path $_.FullName -DestinationPath ("C:\Extracted\" + $_.BaseName) }. This extracts each ZIP into a subfolder named after the file.