Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Zip Command in Windows: How to Create and Extract ZIP Files

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Windows does not have a built-in zip command like Linux or macOS. Instead, you use File Explorer's built-in compression feature or PowerShell's Compress-Archive cmdlet. The quickest way to zip a file or folder is to right-click it in File Explorer, choose Send to > Compressed (zipped) folder, and name the new archive. To unzip, right-click the .zip file and select Extract All. For command-line automation, open PowerShell and run Compress-Archive -Path "C:\Folder" -DestinationPath "C:\archive.zip". This guide walks through both methods, plus common pitfalls and fixes.

What You'll Need

  • A Windows 10 or Windows 11 PC (the steps are nearly identical; minor label differences are noted).
  • Files or folders you want to compress. Ensure you have read access to them.
  • For PowerShell: Windows PowerShell 5.1 or PowerShell 7+ (both include Compress-Archive).
  • Enough free disk space for the resulting .zip file (usually smaller than the original, but not always).

Step-by-Step

Method 1: Zip with File Explorer (no command line)

  1. Open File Explorer and navigate to the file or folder you want to compress.
  2. Select the item. To zip multiple items, hold Ctrl and click each one, or drag a selection box around them.
  3. Right-click the selection, choose Send to, then Compressed (zipped) folder. (On Windows 11, you may need to click Show more options first to see Send to.)
  4. A new .zip file appears in the same folder, highlighted for renaming. Type a descriptive name and press Enter.
  5. To verify, double-click the .zip file. It opens like a folder showing the compressed contents.

To extract: Right-click the .zip file and choose Extract All…. Pick a destination folder (the default is a folder named after the archive) and click Extract. You can also double-click the .zip and drag files out, but Extract All preserves the folder structure and is safer for large archives.

Method 2: Zip with PowerShell (command line)

  1. Open PowerShell: press Win + X and choose Windows PowerShell or Terminal (Windows 11). No admin rights are needed for zipping personal files.
  2. Navigate to the folder containing your items using cd, for example: cd "C:\Users\YourName\Documents".
  3. Run the compression command. To zip a single folder: Compress-Archive -Path "MyFolder" -DestinationPath "MyFolder.zip". To zip multiple items, separate paths with commas: Compress-Archive -Path "File1.txt","File2.txt" -DestinationPath "Archive.zip".
  4. To include everything in the current directory, use -Path *. To update an existing archive, add -Update; to overwrite, add -Force.
  5. Confirm the archive was created by listing the directory: Get-ChildItem *.zip.

To extract with PowerShell: Use Expand-Archive -Path "Archive.zip" -DestinationPath "C:\Extracted". Add -Force to overwrite existing files. The destination folder is created if it does not exist.

Common Mistakes

  • Zipping an already-compressed file. Trying to compress .jpg, .mp4, or .docx files again yields little size reduction. ZIP is best for text, logs, and uncompressed formats.
  • Using the wrong path in PowerShell. Paths with spaces must be quoted. A missing quote causes errors like "Cannot find path."
  • Assuming zip works in Command Prompt. The zip command is not native to Windows. Typing zip in cmd returns "'zip' is not recognized." Use PowerShell or File Explorer instead.
  • Extracting into the same folder without checking. If files with the same names exist, Windows asks before overwriting. Read the prompt; clicking "Yes to All" can replace newer files with older ones.
  • Forgetting that Compress-Archive has a 2 GB limit per file in Windows PowerShell 5.1. For larger files, use PowerShell 7+ or a third-party tool. (This limit does not apply to File Explorer's zip feature.)

Tips

  • Name archives clearly: include a date (e.g., ProjectBackup_2025-06.zip) to avoid confusion.
  • Use Extract All rather than dragging files out; it handles nested folders reliably.
  • To password-protect a zip, Windows' built-in tools cannot do it. You need a third-party archiver like 7-Zip. Only download from the official site.
  • For recurring backups, save your PowerShell command in a .ps1 script and schedule it with Task Scheduler.
  • Check the archive after creation by opening it and confirming the file count matches the source.

Troubleshooting

"Compress-Archive is not recognized." You are likely in Command Prompt, not PowerShell. Close the window, open PowerShell, and try again. If it still fails, your PowerShell version may be too old; update via Windows Update.

"Access to the path is denied." The file may be open in another program or you lack permissions. Close any app using the file, or copy it to your Documents folder and retry.

Zip file is corrupt or won't open. Re-download or re-create the archive. If it came from elsewhere, ask the sender to re-zip it. Windows' built-in extractor sometimes struggles with very large or split archives; try 7-Zip as a fallback.

Extraction stops with "path too long." Windows has a 260-character path limit unless long paths are enabled. Extract to a shorter path like C:\Temp instead of a deep folder tree.

PowerShell says "The archive file already exists." Add -Force to overwrite, or choose a different destination name. Without -Force, the command refuses to replace an existing file.

Files are missing after extraction. Check whether the zip contains them by opening it in File Explorer first. If they are there but not extracted, ensure you used Extract All and did not cancel midway.

Frequently Asked Questions

Is there a real zip command in Windows?

No. Windows does not include a native zip command in Command Prompt. The equivalent is PowerShell's Compress-Archive, or the right-click Send to menu in File Explorer.

Can I zip files without installing anything?

Yes. File Explorer's built-in compression works on all supported Windows versions and requires no extra software.

How do I zip a folder with a password?

Windows' built-in tools cannot add passwords to zip files. You need a third-party program such as 7-Zip, available from its official website. Be cautious with files from untrusted sources.

What is the maximum size for a zip file in Windows?

File Explorer's zip feature has no practical size limit beyond your disk space. PowerShell's Compress-Archive in Windows PowerShell 5.1 caps individual files at 2 GB; PowerShell 7+ removes that limit.

Why does my zipped folder not shrink much?

ZIP compression works best on text and uncompressed data. Photos, videos, and modern Office files are already compressed, so zipping them saves little space.

Can I zip files on a Mac and open them on Windows?

Yes, standard .zip archives are cross-platform. Just avoid Mac-specific formats like .zipx unless the Windows tool supports them.