3

I added a new file extension to the windows compressed file using the following regedit script and it works perfectly (mostly)

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.zab]
@="CompressedFolder"
"Content Type"="application/x-zip-compressed"
"DontCompressInPackage"=""
"PerceivedType"="compressed"

[HKEY_CLASSES_ROOT\.zab\OpenWithProgids]
"CompressedFolder"=""

[HKEY_CLASSES_ROOT\.zab\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"

Now I want to change .zab file icons to something different from the .zip icons. I have tried both DefaultProgramEditor and FileTypesMan program to change the icon but both change both zip and zab file extensions because they are both compressed file types aka share the same progID in the registry.

How would I go about changing the icon for just the .zab extension? Is there a way to add a "sub progID" to compressed file type and then assign .zab to that sub type and then give it a new icon?

Backstory: I have some audio books that I keep each book zipped and stored with the ebook. I want to use a specific program to open and play this specific extension without having to extract the entire book each time, but I also want the ability to see inside the compressed file in windows explorer without extracting. So yes I want zip and zab to be seen as compressed files by Windows Explorer and the program I use to listen to them with, but I want an easy icon to easily see the zab files.

I have found How to change the icon associated with a particular file format (and only that file format) on Windows 10? and https://learn.microsoft.com/en-us/windows/win32/shell/how-to-assign-a-custom-icon-to-a-file-type?redirectedfrom=MSDN but they don't seem to be quite what I want and found https://www.winhelponline.com/blog/change-default-icon-file-type-windows/ "It’s possible to change the default icon for a file type without affecting other file types. To do that, you’ll need to create a new file class or ProgID for the file extension, and assign the default icon in the newly created file class." but I am not proficient enough to create with without examples and once again this doesn't quite seem to fit as I want to keep the file class the the same so that both function in file explorer as compressed files.

(edited all .zap to .zab, (dyslexia such fun /sarcasm) and now you might understand why I'm so insistent on zab and zip having different icons)

2 Answers 2

1

Nirsoft's FileTypesMan tool

On Windows 11, I used the freeware utility called Nirsoft's FileTypesMan tool ;

Registry Changes investigation:

After using it it appears that it modifies the file extensions associated Default Programs DefaultIcon to the ico file that you define.

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\...<default program>...\DefaultIcon]


Note: This response is a replica of this answer

0
  1. Your question repeatedly mentions the ".zap" file extension, but that added to the registry is for ".zab".
  2. The icon is set by indirection. As an example, 7-Zip sets the icon for .7z extension as follows.

Icon indirection

  • The key .7z has a (Default) value of 7-Zip.7z.
  • The key 7-Zip.7z has subkey DefaultIcon.
  • That key has a (Default) value pointing to the file containing the icon and its enumeration in the resource.

However, Windows may or may not respect that icon. If one selects a .7z file and, using Explorer, sets the default application to open it as Notepad, the icon for all .7z files changes to that of Notepad.

1
  • I fixed the zap/zab mix up and added edit about it. This does not work, it still shows all .zab icons as zip icons. This is the reason I think .zab needs a different or sub ProgID, but then I need to assign that ProgID to compressed folder and don't know how to do that.
    – Anna
    Commented Dec 10, 2023 at 1:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .