Restore Full Folder and File Names for Project Archives on Windows

Background

When using the Project Archive tool to extract project archives, you may encounter issues with long file paths and nested subfolder structures that can exceed the standard Windows path limit of 260 characters. To prevent broken archive files and extraction errors, the Project Archive tool automatically truncates folder and file names during extraction.

To help you restore the full folder and file names after extraction, Procore includes a CSV path mapping file (path-map.csv) within the extracted archive folder. This file lists each truncated name alongside its corresponding full name. You can use the CSV file along with a standard PowerShell script to quickly restore all complete item names.

Things to Consider

  • Additional Information:

    • Do not run the PowerShell script on an unextracted .zip archive file.

    • Close any open files or documents located inside the extracted archive folder before running the PowerShell script to prevent file-locking errors.

    • Running the PowerShell script multiple times is safe if certain folder or file names were already partially restored.

Prerequisites

Steps

Open the Extracted Archive Folder

  1. Unzip your downloaded .zip archive file.

  2. Open the unzipped archive folder in File Explorer.

  3. Verify that the path-map.csv file is present in the archive folder.
    Note: This CSV file contains three columns: Type, ShortenedName, and OriginalName.

Open PowerShell in the Extracted Archive Folder

Important

You must open PowerShell inside the extracted archive folder path. If it is opened from another location, the PowerShell script will not locate path-map.csv or your files.

Choose one of the following methods:

Option A: Address Bar (Recommended)

  1. In your Windows system, open File Explorer.

  2. In File Explorer, navigate into the extracted archive folder so that the path-map.csv file is visible.

  3. Click an empty area on the 'Address Bar' at the top of the window (where the file path is listed).

  4. Type powershell and press Enter.
    The Windows PowerShell window opens, targeting your extracted archive folder path.

Option B: Context Menu

  1. In your Windows system, open File Explorer.

  2. Open the extracted folder in File Explorer.

  3. Press and hold the Shift key, then right-click on an empty area inside the folder window.

  4. Select Open PowerShell window here (on Windows 11, select Open in Terminal).

Verify Your Directory

In the PowerShell window, type dir and press Enter.

  • If path-map.csv is listed in the output, you are in the correct directory.

  • If path-map.csv is not listed, navigate to the folder by entering the following command (replacing the path with your actual directory path):

    • cd "C:\full\path\to\your-extracted-folder"

Run the PowerShell Script

  1. Copy the script block below:

    • # Run from inside the extracted folder (the one containing path-map.csv)
      $map = Import-Csv ".\path-map.csv"

      # Rename folders first (deepest matches first so parent renames don't break child paths)
      $map | Where-Object { $_.Type -eq 'Folder' } | ForEach-Object {
      $short = $_.ShortenedName; $orig = $_.OriginalName
      Get-ChildItem -Directory -Recurse |
      Where-Object { $_.Name -eq $short } |
      Sort-Object { $_.FullName.Length } -Descending |
      ForEach-Object { Rename-Item -LiteralPath $_.FullName -NewName $orig }
      }

      # Then rename files
      $map | Where-Object { $_.Type -eq 'File' } | ForEach-Object {
      $short = $_.ShortenedName; $orig = $_.OriginalName
      Get-ChildItem -File -Recurse |
      Where-Object { $_.Name -eq $short } |
      ForEach-Object { Rename-Item -LiteralPath $_.FullName -NewName $orig }
      }

  2. Paste the code into your active PowerShell window and press Enter.

  3. Once execution finishes, all folders and files within the extracted archive folder will display their full names.

See Also

Loading related articles...