Share via

How do I export file Properties Details metadata, INCLUDING "Program description" into csv or Excel format?

Silicon Surfer Ltd 25 Reputation points
2026-03-27T08:50:36.6733333+00:00

I've seen an earlier powershell script that appears to show all the fields for the 'Details' tab for a file, but strangely it misses off the Program Description file (see below)? Using Windows 11, looking to extract this to excel so I can find duplicates (using both Title & Program description). Thanks image

Windows for home | Windows 11 | Files, folders, and storage
0 comments No comments

Answer accepted by question author
  1. MUSTAFA SALAH 1,285 Reputation points
    2026-03-28T03:50:35.92+00:00

    Tested

    User's image

    # 1. Set your paths
    $sourceFolder = "C:\Your\Folder\Path" # <--- CHANGE THIS
    $csvOutput = "$env:USERPROFILE\Desktop\Full_Metadata_Export.csv"
    
    $shell = New-Object -ComObject Shell.Application
    $folder = $shell.Namespace($sourceFolder)
    $allResults = @()
    
    # Get all files
    $files = Get-ChildItem -Path $sourceFolder -File
    
    foreach ($file in $files) {
        $shellFile = $folder.ParseName($file.Name)
        
        # Start with basic File System & Version Info (This catches "Program description")
        $properties = [ordered]@{
            "FileName"           = $file.Name
            "ProgramDescription" = $file.VersionInfo.FileDescription
            "ProductVersion"     = $file.VersionInfo.ProductVersion
            "Full_Path"          = $file.FullName
        }
    
        # Now loop through all 320+ Windows Shell Property Slots (Title, Authors, etc.)
        for ($i = 0; $i -lt 321; $i++) {
            $name = $folder.GetDetailsOf($null, $i)
            if ($name) {
                $value = $folder.GetDetailsOf($shellFile, $i)
                # We only add the column if it's not already there and has a value
                if (-not $properties.Contains($name) -and ![string]::IsNullOrWhiteSpace($value)) {
                    $properties[$name] = $value
                }
            }
        }
    
        $allResults += New-Object PSObject -Property $properties
    }
    
    # 2. Export to CSV
    $allResults | Export-Csv -Path $csvOutput -NoTypeInformation -Encoding utf8
    Write-Host "Done! Exported to $csvOutput" -ForegroundColor Green
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.