In the previous tip we showed how you can fine-tune „Windows Terminal“ and add new entries to the list of launchable applications. If you want to add icons for these entries, you need appropriate icon files.

Here is some PowerShell code that extracts icons from executables. You can use the generated ICO-files in Windows Terminal and elsewhere.

# create output folder
$destination = "c:\icons"
mkdir $destination -ErrorAction Ignore


Add-Type -AssemblyName System.Drawing

# extract PowerShell ISE icon
$path = "$env:windir\system32\windowspowershell\v1.0\powershell_ise.exe"
$name = "$destination\ise.ico"
[System.Drawing.Icon]::ExtractAssociatedIcon($path).ToBitmap().Save($name)

# extract Visual Studio Code icon
$Path = "$env:LOCALAPPDATA\Programs\Microsoft VS Code\code.exe"
$name = "$destination\vscode.ico"
[System.Drawing.Icon]::ExtractAssociatedIcon($path).ToBitmap().Save($name)

explorer $destination 




Twitter This Tip! ReTweet this Tip!

Anonymous