# Extract CHM using Windows PowerShell and COM param( [string]$ChmFile = "C:\GEVISOFT\Documentation\GeViSoft .NET SDK API Documentation.chm", [string]$OutputDir = "C:\DEV\COPILOT\SOURCES\GeViSoft_NET_SDK_API" ) Write-Host "Extracting $ChmFile..." Write-Host "Output: $OutputDir" # Create output directory New-Item -ItemType Directory -Force -Path $OutputDir | Out-Null # Try using 32-bit PowerShell to run hh.exe & "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe" -Command @" `$chmFile = '$ChmFile' `$outputDir = '$OutputDir' & hh.exe -decompile `$outputDir `$chmFile Write-Host 'Extraction completed' "@ # Count extracted files $fileCount = (Get-ChildItem -Path $OutputDir -Recurse -File -ErrorAction SilentlyContinue).Count Write-Host "Total files extracted: $fileCount" if ($fileCount -eq 0) { Write-Host "Extraction failed. Trying alternative method..." # Alternative: Copy CHM and try to read it via itss:// protocol Write-Host "CHM files can be read using the itss:// protocol" Write-Host "Manual extraction may be needed using a tool like 7-Zip" }