How to change the icon of text files?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
ubose
Posts: 4
Joined: Wed May 03, 2023 9:08 pm

How to change the icon of text files?

Post by ubose »

TextPad 9 is my default application for editing text files. I want to change the icon of the text files to make it the same icon that TextPad shows for the app itself. The icon that appears for the text files is currently:
Capture2.JPG
Capture2.JPG (8.93 KiB) Viewed 2413 times
Last edited by AmigoJack on Tue Oct 17, 2023 8:14 am, edited 1 time in total.
Reason: moved from wrong "HOW-TO" forum; inlining attachment; adding question mark
User avatar
AmigoJack
Posts: 532
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Re: How to change the icon of text files?

Post by AmigoJack »

That's a question about Windows, not TextPad. In current versions this is almost impossible to define per dialogs (while earlier Windows versions made this easier). What works for all versions: using the Registry.
  1. Start the Registry editor (WIN+R, enter regedit, hit OK)
  2. Browse to \HKEY_CLASSES_ROOT\.txt and read the value for the name (Default) - it may be something like txtfile or Textpad.txt
  3. Browse to a key that has that read value in its path, f.e. \HKEY_CLASSES_ROOT\Textpad.txt\DefaultIcon (or \HKEY_CLASSES_ROOT\txtfile\DefaultIcon
  4. Change the value of (Default) to "C:\Program Files\TextPad 9\TextPad.exe",0 (including quotation marks, including comma zero). The file path (C:\Program Files\TextPad 9\) must match where your installation resides. The ,0 part means the first icon in that EXE file. You can browse all available icons of an/that EXE file by
    1. right clicking on such a shortcut (f.e. the TextPad shortcut in your start menu or on your desktop),
    2. choosing "Properties"
    3. using the tab "Shortcut", clicking the button "Change Icon".
    4. In that dialog all available icons are displayed - you just have to count from zero instead of one to select which icon you want.
The change may not take effect immediately - in doubt kill all Explorer instances or simply restart Windows.
Post Reply