Skip to content

Instantly share code, notes, and snippets.

@kevduc
Last active September 20, 2021 14:33
Show Gist options
  • Save kevduc/9601d910373d95ffe9b528b666a2e4b6 to your computer and use it in GitHub Desktop.
Save kevduc/9601d910373d95ffe9b528b666a2e4b6 to your computer and use it in GitHub Desktop.
Extract the icon of an exe file using PowerShell
# Based on https://community.spiceworks.com/topic/592770-extract-icon-from-exe-powershell
[System.Reflection.Assembly]::LoadWithPartialName('System.Drawing') | Out-Null
[System.Drawing.Icon]::ExtractAssociatedIcon('full-path-to/file.exe').ToBitmap().Save('full-path-to/icon.ico')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment