Created
January 20, 2025 10:21
-
-
Save ecspresso/7eef5954670d33b6f0e60eaefda6e92b to your computer and use it in GitHub Desktop.
Extract png from exe with PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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