ShellNew Icon for "." File Type

All we need is an easy explanation of the problem, so here it is.

I have successfully created a ShellNew command so that I can create a new blank file with no file extension, with the reg file being:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.]

[HKEY_CLASSES_ROOT\.]
@="emptyFile"

[HKEY_CLASSES_ROOT\.\ShellNew]
"NullFile"=""
@="Empty File"
"ItemName"=""

[HKEY_CLASSES_ROOT\.\ShellNew\Config]
"NoExtension"=""

[-HKEY_CLASSES_ROOT\emptyFile]

[HKEY_CLASSES_ROOT\emptyFile]
@="Empty File"

[HKEY_CLASSES_ROOT\emptyFile\DefaultIcon]
@="%SystemRoot%\\system32\\imageres.dll,2"

This works fantastic, creating the file just how I want it to, but the icon displayed in the ShellNew window is the icon for the System Partition [below]; how can I change this icon to match the DefaultIcon I am providing for the file type itself?
ShellNew Icon for "." File Type1

  • I have tried making an "Icon" String Value like what I had to do for the Unity and Sublime Text menu items, but that did not work no matter where I put it

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

Try this, which works like magic, with the only change being I added an IconPath at the .ext level (file type associations are amazing stuff!):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.]
@="emptyFile"

[HKEY_CLASSES_ROOT\.\ShellNew]
"NullFile"=""
@="Empty File"
"ItemName"=""
"IconPath"="C:\\windows\\system32\\imageres.dll,2"

[HKEY_CLASSES_ROOT\.\ShellNew\Config]
"NoExtension"=""

[-HKEY_CLASSES_ROOT\emptyFile]

[HKEY_CLASSES_ROOT\emptyFile]
@="Empty File"

[HKEY_CLASSES_ROOT\emptyFile\DefaultIcon]
@="%SystemRoot%\\system32\\imageres.dll,2"

Method 2

Arent you supposed to use “imageres.dll,3” because its 3rd icon in imageres.dll?

You can try Default Programs Editor application, open program, click icons, find file type, click next, choose icon from imageres, and save as .REG file, then check whats inside that .reg.

Method 3

If you are able to find the “Empty File” type in the FileTypesMan tool you might be able to change the Default Icon there.

FileTypesMan: http://www.nirsoft.net/utils/file_types_manager.html

Method 4

For whatever reason, this uses the same default icon as your C drive.

You can see this for yourself by creating the following key, if it doesn’t already exist:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DriveIcons\C\DefaultIcon

And setting the (Default) to:

%SystemRoot%\\system32\\imageres.dll,2

enter image description here

enter image description here

I’m afraid I can’t answer exactly why this behaviour occurs. There’s actually another thread here that manages to change the icon with a different registry key though.

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply