Skip to content

Instantly share code, notes, and snippets.

@ecspresso
Created January 20, 2025 10:21
Show Gist options
  • Save ecspresso/7eef5954670d33b6f0e60eaefda6e92b to your computer and use it in GitHub Desktop.
Save ecspresso/7eef5954670d33b6f0e60eaefda6e92b to your computer and use it in GitHub Desktop.
Extract png from exe with PowerShell
# https://learn-powershell.net/2016/01/18/getting-the-icon-from-a-file-using-powershell/
# (archive link) https://web.archive.org/web/20180609182021/https://learn-powershell.net/2016/01/18/getting-the-icon-from-a-file-using-powershell/
$exe = 'path\to\.exe'
$png = 'image.png'
$format = [System.Drawing.Imaging.ImageFormat]::Png
[System.Drawing.Icon]::ExtractAssociatedIcon($exe).ToBitmap().Save($png, $format)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment