ShellNew Icon for "." File Type

8

1

I have successfully created a ShellNew command so that I can create a new blank file with no file extension. The reg file looks like this:

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 and all. It creates the file just how I want it to, but the Icon displayed in the ShellNew window is the icon for the System Partition like so:

1

How can I change this icon to match the DefaultIcon I am providing for the file type itself? I have tried making an "Icon" String Value like what I had to do for the Unity and Sublime Text menu items, and that did not work no matter where I put it.

GodsBane

Posted 2015-05-27T15:56:57.180

Reputation: 83

I can replicate. Trying to figure out if there's a way to fix it... – Karan – 2015-05-27T17:25:22.640

I suppose that you have not yet found a solution? I am thinking that there must be something in the registry stating that since it has no associated file type, it assumes it is a drive? – GodsBane – 2015-05-28T12:43:27.717

Looks like it, and if I had figured it out I would have posted an answer of course. – Karan – 2015-05-28T18:18:56.130

I can not seem to replicate this. – Visual Vincent – 2016-02-19T23:09:07.897

Answers

3

Try this, works like magic.

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"

Only change. I added a IconPath at the .ext level. File type associations are amazing stuff!

w32sh

Posted 2015-05-27T15:56:57.180

Reputation: 8 611

Another thing is, for the the ProgID's DefaultIcon you've set an expandable string, which really should have been of type REG_EXPAND_SZ instead of REG_SZ. Regardless, ShellNew doesn't seem to use the icon defined there. – w32sh – 2016-02-21T14:31:23.373

Yep, that does it. Well done! – Ben N – 2016-02-21T16:44:19.217

Wow, ~9 months old, and such a simple fix. Awesome job! – GodsBane – 2016-02-21T19:41:18.763

It said the bounty was about to close "in 2 hours". That's when I replied :) – w32sh – 2016-02-22T03:57:02.983

0

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

Stian Lund

Posted 2015-05-27T15:56:57.180

Reputation: 51

I am under the impression that those kind of tools just do what the OP did manually, but I'll try it when I get time. – Ben N – 2016-02-16T22:57:17.333

@BenN I guess you're correct - I assumed OP just wanted to 'fix' it but I guess they want to find a regedit solution. – Stian Lund – 2016-02-17T12:12:05.180

Somewhere windows must be overriding the icon because FileTypesMan sees the correct icon, displays it there, and yet the ShellNew still displays the OS drive icon. This still is the case in Windows 10, even though I doubted that would have changed. – GodsBane – 2016-02-17T22:30:03.467

0

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.

Jonno

Posted 2015-05-27T15:56:57.180

Reputation: 18 756

0

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.

orion310591

Posted 2015-05-27T15:56:57.180

Reputation: 1

You can't use Default Programs Editor for this because the file that it makes has no extension. – GodsBane – 2015-07-27T15:44:24.870

@orion310591: The index starts from 0. So it's technically the 2nd icon. – w32sh – 2016-02-21T14:27:08.023