Windows executable files (New or Portable executables) can contain icons. How can I extract them, either as ICO files or separate images?


There are a number of tools you can use.

icoutils, available as the eponymous package in many distributions, includes a tool capable of extracting resources from most Windows executables, wrestool.

wrestool -x --output=. -t14 /path/to/windows.exe

will extract the icons present in the given Windows executable and write them to individual files, named after the executable name, with the type and icon name added.

7z can also extract all the resources in a Windows executable;

7z x /path/to/windows.exe .rsrc/ICON

will extract all the icons in the given Windows executable and write them to individual files in the .rsrc/ICON directory.

  • In Linux Mint, icoutils seems to be already installed (v0.32.3-1 in my case), but the utility is called wrestool instead of wrestop. The parameters are the same, though. – Ronny D'Hoore Sep 24 at 17:37
  • Indeed, thanks @Ronny! – Stephen Kitt Sep 24 at 21:57

To extract an icon from an executable file directly, if you have a Windows link pointing to that executable, you can use Wine's winemenubuilder command:

wine winemenubuilder -t /path/to/link.lnk /path/to/image-out.png

I believe the command will extract the image that the link would use, whether explicitly in the link or implicitly in its target.

If you need to generate a Windows link, you can use the mslink tool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.