Fix "The Compressed (zipped) Folder is invalid" Caused by Long Paths

ZIP archive

Summary

This post shows you how to fix The Compressed (zipped) Folder is invalid by extracting the ZIP archive in SharePoint with Zip & Unzip for SharePoint, or on Windows with tar.exe or PowerShell 7's Expand-Archive.

When a valid ZIP archive contains deeply nested folders and long filenames, Windows File Explorer and its Extract All wizard reject the archive as invalid, even when you extract to a short folder near the drive root:

Windows reporting that the 16-file compressed folder is invalid during extraction to a short destination

Choose one method based on where you need the extracted files:

Why long paths trigger "The Compressed (zipped) Folder is invalid"

File Explorer shows Windows cannot open the folder and The Compressed (zipped) Folder is invalid when an archive is corrupted, or when an intact ZIP contains internal folder and file paths that exceed File Explorer's limit.

The internal path inside the ZIP triggers this failure even when the path is split across several nested folders rather than one long filename. A single-file ZIP with a 200-character internal path opens and extracts normally, whereas a single-file ZIP with a 263-character internal path fails with the same invalid-folder error when opened or extracted into a short folder:

Windows reporting that the ZIP with one 263-character internal file path is invalid

How the extraction path is counted

Every file inside a ZIP has an internal path made up of its nested folders and filename. When you extract the archive, Windows prepends your destination folder and a backslash to that internal path. Giving the .zip file itself a shorter name does not shorten the folder structure inside it.

In the 16-file example archive (Q3 2026 Investment Research Pack.zip), the deepest internal path is 263 characters. Extracting it into C:\x\pf-t16 (11 characters) produces a 275-character full path on your PC (11 + 1 + 263 = 275 characters).

To measure an extracted file's full path on your PC:

  1. Reveal the folder path in File Explorer
    • Open the file's containing folder and click the address bar to display the full text path.
  2. Count the folder path and filename
    • Add the folder path, a backslash, and the filename with its extension. If File Explorer abbreviates a folder name with ~1, count the complete folder name instead.

The SharePoint and OneDrive path-length guide explains how this local PC path differs from a SharePoint web path. Option A shortens long folder paths inside SharePoint before extracting, while Options B and C unpack the archive into a short local folder under C:\x.

Option A: Extract in SharePoint with Zip & Unzip

When the archive belongs in a SharePoint document library that syncs with OneDrive, upload the .zip to SharePoint and extract it with Zip & Unzip for SharePoint (see the SharePoint ZIP guide). It unpacks the archive in your browser and checks both SharePoint's 400-character limit and your 259-character Windows PC limit before extracting:

  1. Check SharePoint and Windows PC path limits
    • Zip & Unzip always checks SharePoint's 400-character limit automatically.
    • Expand Path length settings and check Check my Windows PC path to verify your predicted PC path and OneDrive folder name. Your admin can also enable this setting once for your whole organization.
  2. Rename or skip files that are too long
    • Zip & Unzip pauses before extracting any over-limit files so you can click Rename to shorten a path or Skip to exclude the file.
  3. Shorten a parent folder to fix every file inside it
    • Edit any folder or file name in the path chain. Shortening one parent folder fixes every file inside it at once.
Three steps in Zip & Unzip for SharePoint: Check Windows PC path limit in Extract File, Rename or skip flagged files, and Shorten a parent folder once

Try the interactive demo

The interactive demo below shows how the Zip & Unzip add-in checks and shortens long file paths inside SharePoint. Try it to preview the solution:

For help with Zip & Unzip for SharePoint, contact support.

Option B: Extract on Windows with tar

Open PowerShell 7 and use Windows' built-in tar.exe utility to unpack the archive into a short folder near the drive root. Replace the example ZIP filename with your own archive:

  1. Set the ZIP and destination paths
    • Point $zip to your archive and $destination to a short folder near C:\:
$zip = "$env:USERPROFILE\Downloads\Q3 2026 Investment Research Pack.zip"
$destination = 'C:\x\pf-t16'
  1. Create the destination folder and extract with tar.exe
New-Item -ItemType Directory -Path $destination | Out-Null
tar.exe -xf $zip -C $destination
PowerShell 7 running tar.exe and counting 16 extracted files in C:\x\pf-t16

tar.exe extracts all 16 files from the archive that File Explorer rejected, with full PC paths ranging from 145 to 275 characters.

Option C: Use PowerShell 7 Expand-Archive

PowerShell 7's Expand-Archive cmdlet also extracts long-path ZIP archives that File Explorer blocks:

  1. Set the ZIP and destination paths
    • Point $zip to your archive and $destination to a fresh folder near C:\:
$zip = "$env:USERPROFILE\Downloads\Q3 2026 Investment Research Pack.zip"
$destination = 'C:\x\pf-e16'
  1. Create the destination folder and run Expand-Archive
New-Item -ItemType Directory -Path $destination | Out-Null
Expand-Archive -LiteralPath $zip -DestinationPath $destination -ErrorAction Stop
PowerShell 7 running Expand-Archive and counting 16 extracted files in C:\x\pf-e16

PowerShell 7 extracts all 16 files into C:\x\pf-e16, with full PC paths from 145 to 275 characters.

Verify the extracted files and shorten deep paths

In the same PowerShell 7 window, count the extracted files recursively to make sure no deep entries were skipped:

$files = @(Get-ChildItem -LiteralPath $destination -File -Recurse)
$files.Count

Both command-line methods return 16, matching the total file count inside the archive. Always check the deepest subfolder rather than assuming extraction succeeded just because the top-level folder appeared.

Unpacking the archive locally does not shorten the extracted paths themselves. Because the deepest files here reach 275 characters on your PC and desktop Excel blocks workbooks at 260 characters and above, move deep workbooks higher or shorten their parent folders before opening them, as shown in the Excel 259-character error guide.

If File Explorer opens your ZIP but stops mid-extraction with Path too long - Error 0x80010135, see the Error 0x80010135 extraction guide.