Windows 10 has a tool called PSR (Steps Recorder) that allows you to get screenshots from and steps when an issue occurs.
The tool generates a ZIP file, and within that ZIP file you can find an MHTML document that you can open with IE or Microsoft Word.
Now, what if you want to extract all the pictures from that MHTML?
Here’s the script to do it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
#Choose MHT File PowerShell Dialog $openFileDialog = New-Object windows.forms.openfiledialog $openFileDialog.initialDirectory = [System.IO.Directory]::GetCurrentDirectory() $openFileDialog.title = "Select your MHT File" $openFileDialog.filter = "MHT Files (*.mht)| *.mht" $openFileDialog.ShowHelp = $True Write-Host "Select MHT File... (see FileOpen Dialog)" -ForegroundColor Green $result = $openFileDialog.ShowDialog() # Display the Dialog / Wait for user response # in ISE you may have to alt-tab or minimize ISE to see dialog box $result if($result -eq "OK") { Write-Host "Selected MHT File:" -ForegroundColor Green $OpenFileDialog.filename # $OpenFileDialog.CheckFileExists Write-Host "MHT File Selected!" -ForegroundColor Green } else { Write-Host "MHT File Not Opened!" -ForegroundColor Yellow break } $MyFile=$openFileDialog.FileName Function Get-Folder($initialDirectory="") { [System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms")|Out-Null $foldername = New-Object System.Windows.Forms.FolderBrowserDialog $foldername.Description = "Select a folder" $foldername.rootfolder = "MyComputer" $foldername.SelectedPath = $initialDirectory if($foldername.ShowDialog() -eq "OK") { $folder += $foldername.SelectedPath } return $folder } $targetfolder = Get-Folder if($targetfolder -ne $null) { Write-Host "Selected Destination Folder OK" -ForegroundColor Green } else { Write-Host "Destination Folder Not Selected!" -ForegroundColor Yellow} $Path = $MyFile $Destination = $targetfolder $nameRE = [regex]"^Content-Location: (?<Name>screenshot\d{4}.JPEG)$" $nextRE = [regex]"^--=_NextPart" $imagePart = $false $base64 = "" switch -regex -file $Path { '^$' {} $nameRE { $name = $nameRE.Match($_).Groups['Name'].Value $file = Join-Path $Destination $name $imagePart = $true } $nextRE { if ($imagePart) { $byte = [Convert]::FromBase64String($base64) [IO.File]::WriteAllBytes($file, $byte) $imagePart = $false $base64 = "" } } default { if ($imagePart) { $base64 += $_ } } } # SIG # Begin signature block # MIIQTwYJKoZIhvcNAQcCoIIQQDCCEDwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR # AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUofNFWPryx4CehGGHDkITFNzZ # kJOggg0uMIIGbTCCBFWgAwIBAgIQbHhbaf7xO+Fe08DSLHaMejANBgkqhkiG9w0B # AQsFADBWMQswCQYDVQQGEwJQTDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVt # cyBTLkEuMSQwIgYDVQQDExtDZXJ0dW0gQ29kZSBTaWduaW5nIDIwMjEgQ0EwHhcN # MjEwNzMwMTI1NjEwWhcNMjIwNzMwMDY1OTQyWjCBkjELMAkGA1UEBhMCUk8xEDAO # BgNVBAcMB0NoaWFqbmExHjAcBgNVBAoMFU9wZW4gU291cmNlIERldmVsb3BlcjEu # MCwGA1UEAwwlT3BlbiBTb3VyY2UgRGV2ZWxvcGVyLCBBbmRyZWkgUmF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