1

Are there other custom registry settings for the Open With items?

What I'm wondering is if I can use the registry to give a custom icon instead of using the interpreters icon?


Responding to the request to dump a registry key, here it is (anonymized):

C:\>reg query "HKCR\Applications\scriptapp.exe" /s

HKEY_CLASSES_ROOT\Applications\scriptapp.exe
    (Default)    REG_SZ    ScriptApp

HKEY_CLASSES_ROOT\Applications\scriptapp.exe\DefaultIcon
    (Default)    REG_EXPAND_SZ    C:\Util\icos.dll,1

HKEY_CLASSES_ROOT\Applications\scriptapp.exe\shell

HKEY_CLASSES_ROOT\Applications\scriptapp.exe\shell\open
    DefaultIcon    REG_SZ    C:\Util\icos.dll,1
    FriendlyAppName    REG_SZ    ScriptApp

HKEY_CLASSES_ROOT\Applications\scriptapp.exe\shell\open\command
    (Default)    REG_SZ    "C:\Util\strawberry\perl\bin\wperl.exe" "c:\Util\Scripts\launch_master.pl"
9
  • Do you mean a registry hack like in this article? If not, what do you see in regedit under the HKEY_CLASSES_ROOT entry for your Open With item?
    – harrymc
    Aug 6, 2014 at 12:46
  • @harrymc, that has to do with giving the file type an icon. I want to know if I can set the icon in an OpenWith list or dialog. Because the interpreter of the script is the executable, I just get the interpreter's icon.
    – Axeman
    Aug 6, 2014 at 13:11
  • 1
    Do you want to change the icon for the interpreter? You can add an icon to its exe using Resource Hacker. See also this article. Placing the icon as first will make it the default.
    – harrymc
    Aug 6, 2014 at 14:25
  • Did you try setting a DefaultIcon as explained in the following article? Application Registration
    – and31415
    Aug 6, 2014 at 15:28
  • @and31415, cool article, but doesn't seem to have worked.
    – Axeman
    Aug 7, 2014 at 0:42

4 Answers 4

3
+50

I believe that the only way to change the icon that is displayed on the OpenWith executable, is to change that icon inside that executable (or add one).

You can add an icon to its exe using Resource Hacker.
For details, see the article : Windows 7: Icons - Change Using Resource Hacker.

Placing the new icon as first will make it the default.


Another idea would be to assign different file-types to your scripts, for example .my1 for script1.my1 and .my2 for script2.my2, and give each file-type a different icon, as described in this article.

Define all file-types as executing "\path\interpreter.exe %1" where %1 stands for the script parameter.

That will give you a different icon per each script file-type, and you will not need at all the OpenWith dialog box - just double-click the script-file. The script-files will automatically be displayed in Explorer with their icons.

If the Windows file-types tool is unwieldy, you could use FileTypesMan.
You can also load such file-types directly into the registry with a .reg file.

2
  • I was hoping for a niftier way that I just couldn't find documentation for. The interpreter icon doesn't bother me so much that I can't live with it. As long as it has the title that I wanted, which it does.
    – Axeman
    Aug 8, 2014 at 19:46
  • I added another idea above.
    – harrymc
    Aug 8, 2014 at 20:26
1

No, you can't change the icon in "Open With".

The key HKEY_CLASSES_ROOT\Applications\scriptapp.exe\DefaultIcon is for changing the icon of the files associated with scriptapp.exe.

Creating a value of DefaultIcon in HKEY_CLASSES_ROOT\Applications\scriptapp.exe\shell\open is not supported.

As others have suggested, if this is necessary, you should change the icon for scriptapp.exe.

3
  • There is no scriptapp.exe. It is simply the entry under Applications so that I can use a Perl script as an OpenWith entry. That would require me to change the icon for Perl, and the whole idea was to deploy more scripts as "OpenWith Apps".
    – Axeman
    Aug 7, 2014 at 22:35
  • @Axeman What I said still applies. Since it's not possible, perhaps you could explain more of your situation. I'm sure the community could help you find a better way.
    – Jason
    Aug 8, 2014 at 1:09
  • I was hoping for a niftier way that I just couldn't find documentation for. The interpreter icon doesn't bother me so much that I can't live with it. As long as it has the title that I wanted, which it does.
    – Axeman
    Aug 8, 2014 at 19:46
0

There is no scriptapp.exe. It is simply the entry under Applications so that I can use a Perl script as an OpenWith entry. That would require me to change the icon for Perl, and the whole idea was to deploy more scripts as "OpenWith Apps".

No idea what this mean and why this need.

Probably you need compile .pl script to .exe with PP and with option set icon. More info

1
  • I can also write a little AHK (Autohotkey) script to encapsulate the command line and compile it with their compiler. But the object was to see how far I could go in creating an "Application" with just an interpreter, a script, and some config. Each script would be a different "application".
    – Axeman
    Aug 8, 2014 at 19:54
0

I was looking for a way to change the default icon of a file type extension, and google brought me to this question. So maybe this information can be useful for someone else. I successfully changed the file type icon using FileTypesMan. Locate the file type and edit (F2), replacing the "Default Icon" value.

Or you can do it manually. On regedit go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\[.ext]\UserChoice and locate the ProgId which should be something like AppX_long_sequence_of_numbers_and_letters. Then go to HKEY_CLASSES_ROOT\AppX_long_sequence_of_numbers_and_letters and change the DefaultIcon setting.

You must log in to answer this question.

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