top of page
Black Chips
Search

Extract an EXE Icon to PNG Using PowerShell (No Installs Needed)

  • Writer: Josue Valentin
    Josue Valentin
  • Oct 8, 2025
  • 1 min read

If you want to grab the icon from a Windows application without installing any third-party software, PowerShell can handle it natively using built-in .NET libraries. This method is ideal for creating documentation, shortcuts, or deployment visuals when you need the actual program icon as a PNG file.


What This Script Does


The script lets you browse for any .exe file, extracts its main application icon, and saves it as a transparent .png file in the same folder. Everything runs locally with no external dependencies.


The Script


Add-Type -AssemblyName System.Windows.Forms

Add-Type -AssemblyName System.Drawing

Add-Type -AssemblyName PresentationCore


# Open file browser to pick an EXE

$dialog = New-Object System.Windows.Forms.OpenFileDialog

$dialog.Filter = "Executable Files (*.exe)|*.exe"

$dialog.Title = "Select an EXE to extract the icon from"


if ($dialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {

$exe = $dialog.FileName

$out = [IO.Path]::ChangeExtension($exe, ".png")


$icon = [System.Drawing.Icon]::ExtractAssociatedIcon($exe)

$bitmap = $icon.ToBitmap()


$fs = New-Object IO.FileStream($out, [IO.FileMode]::Create)

$bitmap.Save($fs, [System.Drawing.Imaging.ImageFormat]::Png)

$fs.Close()


Write-Host "Saved PNG icon to $out"

} else {

Write-Host "No file selected."

}

 
 
 

Related Posts

See All
You can’t protect what you don’t monitor

Systems don’t fail overnight. They drift. Small changes accumulate. Signals fade. Visibility is lost. Continuous monitoring brings clarity and clarity brings control. Security isn’t guessing. It’s see

 
 
 
Untitled

Phishing Doesn’t Look Like an Attack Most phishing emails don’t look suspicious. They look familiar. A known sender. A normal request. A message that feels routine. That’s why phishing still works. St

 
 
 
Ransomware attacks rarely begin with a single click.

They start with small gaps: unpatched systems, excessive access, or configurations no one reviewed. Prevention isn’t about reacting faster. It’s about reducing exposure before it becomes an incident.

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

IT Services

Fully Managed IT Solutions
Custom IT Services
Cyber Security Services
Business Phone Systems

Contact Info

Address:
Chicopee, Massachusetts 01013
Email: sales
@technetne.com

Social

  • Facebook
  • LinkedIn
Minority Own Business

Copyright © 2025 TechNet New England. All Rights Reserved. | Terms and Conditions | Privacy Policy

bottom of page