Windows 10: Changing icon for one file extensions modifies it for another

Discus and support Changing icon for one file extensions modifies it for another in Windows 10 Customization to solve the problem; I am running into some issues trying to change the .ico file associated with a particular file extension. At the moment 2 extensions Rmd and R share... Discussion in 'Windows 10 Customization' started by missionman13, Jun 20, 2019.

  1. Changing icon for one file extensions modifies it for another


    I am running into some issues trying to change the .ico file associated with a particular file extension. At the moment 2 extensions Rmd and R share the same icon (shown below).


    Changing icon for one file extensions modifies it for another oQIxFJX.png


    I launched FileTypesMan and here is the view for both R and Rmd extension

    Changing icon for one file extensions modifies it for another K6th7vv.png


    I have an icon file which I have saved in the save location “rmarkdown_icon.ico”. I go back into FileTypesMan to try and change this, which seems to work

    Changing icon for one file extensions modifies it for another AlvOLFS.png


    The issue that both the R and Rmd extensions get changed (rather than just the Rmd extension)

    Changing icon for one file extensions modifies it for another bNRV5yX.png



    I have been attempting to change the icon with .Rmd using FileTypesMan but when I do it switches the icon associated with BOTH Rmd and R and I believe this is based on the "Rmd_auto_file" contained within the following path in regedit.

    HTML Code: Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.Rmd\OpenWithProgids[/quote] As per my understanding based on some extensive Google searches, an icon is being attributed to everything that RStudio opens rather than a specific filetype (which is what we are trying to accomplish). I have attempted troubleshooting for quite some time and was wondering if anyone had successfully accomplished this.

    Does anyone have any insight to fix this?

    :)
     
    missionman13, Jun 20, 2019
    #1
  2. sadicus Win User

    CUSTOM file extensions and CUSTOM icon association?


    Windows 10 keeps changing icons associated with custom file extensions. It seems arbitrary because some new file types do work, others work for a while then randomly change.

    1. How to correctly create CUSTOM file extensions and have a CUSTOM icon associated to the extension?
    2. How to stop windows from changing the icons?
    Types-1.3.1 Extension Icon Editor by Frank Worsley was used.
    Types 2.6.2
    If "Linked class" is used the folder icon updates, but the file icon does not.
     
    sadicus, Jun 20, 2019
    #2
  3. Eric Ber Win User
    My package file icons have been changed to explorer icons

    When you delete the file extension in the registry, the icon will change to its default icon. You can always backup the registry before modifying it by following the steps at the link above.

    If you need further assistance, feel free to get back to us.
     
    Eric Ber, Jun 20, 2019
    #3
  4. Mike Win User

    Changing icon for one file extensions modifies it for another

    Changing icons for protected file extensions in Windows 10

    I figured out a hacky workaround, but I would still like to get the answers to my questions above so we can find a proper/less hacky solution.

    Beginner-friendly step-by-step below.

    Create a dummy .cmd file and set it as the always-open-with app for an extension using the GUI. This causes Windows to create a new file type for the dummy .cmd "app" and associate it with the extension by setting the UserChoice key ProdId value (ex: Application/customJPEG.cmd). Repeat this process for each extension using a uniquely named dummy .cmd file and, bam, we have unique file types associated with each extension (ex: Application/customJPEG.cmd, Application/customPNG.cmd, etc.). We can then customize the icon and open/edit commands independently for each new file type.

    See my flowcart in the original question for more information about how Windows chooses the icon for a file.

    Note: This workaround is only required for protected extensions like .jpg and .png. See my question above for solutions to non-protected extensions. However, this workaround should work for any extension regardless.

    Quick vocab:

    • File extension: What comes after the final dot in a filename. .jpg, .jpeg, .png, etc. are all different file extensions.
    • File type: A file classification/category. May be associated with one or more file extensions. For example, the JPEG file type may be associated with both the .jpg and .jpeg file extensions.

    Note: Image file extensions like .jpg and .png show thumbnails of the image. To see the icon, either create an empty file (so a thumbnail can't be generated) or open an Explorer window and set the View to Details.

    Note: You won't see anything change until you refresh the desktop. Make sure to do this after making changes to the registry. See step 6 for details.

    Note: If a key seems to be missing in the registry, try refreshing by pressing F5 or View->Refresh. regedit does not stay up to date and requires a refresh to see the latest.

    Repeat the steps below for each file extension. Replace .jpg with your file extension and Photoshop with whatever app you want.

    1. Create a dummy .cmd file

    1. Open Notepad
    2. You can leave the file empty
    3. File->Save As
    4. Use something like customJEPG.cmd as the filename and save

    It doesn't matter where you save it or what you name it expect the name must be different for each file type. The name of the dummy .cmd will determine the name of the file type. I recommend including the extension or file type in the name so it is easy to distinguish later.

    2. Set the dummy .cmd file as the always-open-with app

    1. Right-click a .jpg file
    2. Open with->Choose another app
    3. Make sure "Always use this app to open .jpg files" is checked
    4. Scroll to the bottom and click "More apps ↓"
    5. Scroll to the bottom again and click "Look for another app on this PC"
    6. Browse to and choose your dummy .cmd file
    7. Ignore and close the "This app can't run on your PC" error
    8. If the "How do you want to open this file?" window pops up again, make sure your dummy .cmd file is still selected under "Keep using this app" at the top, check "Always use this app to open .jpg files", and hit OK.

    If you want multiple file extensions to share the same file type, repeat steps 1-7 above for each extension.

    3. Get the new associated file type

    1. Open regedit
    2. Navigate to:

      HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\UserChoice
    3. Copy/write down the value of ProgId. This is the file type that is now associated with the .jpg extension

    The file type should be Applications\{the name of your dummy .cmd}. Example: Applications\customJPEG.cmd.

    4. Update the file type to use the correct icon

    1. In regedit, navigate to HKEY_CLASSES_ROOT\
    2. Now open the key with the same name as your file type. For example, if your file type is Applications\customJEPG.cmd, You will open:

      HKEY_CLASSES_ROOT\Applications\customJEPG.cmd
    3. Create a new key inside named DefaultIcon
    4. Set the (Default) value of the DefaultIcon key to a path to the icon you want to use. Example:

      E:\Tools\Adobe\Adobe Photoshop CC 2015\Photoshop.exe,30

    5. Update the file type to open and edit with Photoshop

    1. Open the shell\open\command key inside your file type key. Example:

      HKEY_CLASSES_ROOT\Applications\customJEPG.cmd\shell\open\command
    2. Edit the (Default) value so that it points to your Photoshop.exe instead of your dummy .cmd file. Example:

      "E:\Tools\Adobe\Adobe Photoshop CC 2015\Photoshop.exe" "%1"
    3. Create the edit\command key inside the shell key if it does not exist. Example:

      HKEY_CLASSES_ROOT\Applications\customJEPG.cmd\shell\edit\command
    4. Edit the (Default) value so it has the same value as your open\command key. Example:

      "E:\Tools\Adobe\Adobe Photoshop CC 2015\Photoshop.exe" "%1"

    6. Refresh the desktop

    You will not see anything change until you refresh the desktop. There are 3 ways to do so:

    • In windows 10 run ie4uinit.exe -show. In Windows 7 and 8 run ie4uinit.exe -ClearIconCache. (Thanks to @Tony for this tip.)
    • Or, you can simply download and run DesktopRefresh.exe
    • Or, you can restart explorer.exe:
      1. Bring up the Task Manager (ctrl+shift+esc)
      2. Go to the details tab and find explorer.exe
      3. Right-click explorer.exe->End task and click End Process
      4. Still in Task Manager go to File->Run new task
      5. Type explorer.exe and hit OK

    7. Test it out

    1. The correct icons should now be shown for .jpg files.
    2. Double clicking a .jpg file should open it in Photoshop.
    3. Right-click a .jpg file->Edit should open it in Photoshop.

    If the "How do you want to open this file?" window pops up again, make sure your dummy .cmd file is still selected under "Keep using this app" at the top, check "Always use this app to open .jpg files", and hit OK.

    8. Delete the dummy .cmd

    You can delete your dummy .cmd file. This is optional.

    A note about finding icons

    Often, an app's .exe will contain multiple icons. For example, the Photoshop.exe contains all the icons for all the different file types it supports. Here's how to find and use these icons:

    1. Create a shortcut to the .exe by right-clicking and selecting Create shortcut
    2. Right-click the shortcut and select Properties
    3. Click the Change Icon button near the bottom
    4. You will now see a window like this (but without the numbers):


      Changing icon for one file extensions modifies it for another enKUD.png

    5. The icons are numbered starting from 0. Find the number of the icon you want to use. Instead of counting, you can use the formula (column - 1) * 4 + row - 1. For example, if the icon is in column 6, row 3, (6 - 1) * 4 + 3 - 1 = 22
    6. Now you can reference that icon by including the number in the path to the .exe like so:

      C:\Example\Photoshop.exe,23
     
Thema:

Changing icon for one file extensions modifies it for another

Loading...
  1. Changing icon for one file extensions modifies it for another - Similar Threads - Changing icon file

  2. Copy files from one user to another, and change ownership?

    in Windows 10 Support
    Copy files from one user to another, and change ownership?: I'm looking to create a new user on my laptop (20H2 Pro x64) and copy over a bunch of settings and documents from the old user account, and then eventually delete the original account. I seem to recall having permission/ownership problems in the past, when copying files...
  3. Changing a file's extension: disabling the "If you change a file name extension, the file...

    in Windows 10 Customization
    Changing a file's extension: disabling the "If you change a file name extension, the file...: Microsoft Windows [Version 10.0.19042.867] is there a registry key to get rid of it now ? https://answers.microsoft.com/en-us/windows/forum/all/changing-a-files-extension-disabling-the-if-you/dc219745-91fb-4c6b-9821-76fa22cf20c9
  4. File Extension Changes

    in Windows 10 Network and Sharing
    File Extension Changes: My wife tried to open an Excel file she attached to an email before she sent it to make sure it was the right one. That act then proceeded to try to open over 150 files. They were still scrolling across the top when the only thing I could figure out what to do was to sign...
  5. File extension changed

    in AntiVirus, Firewalls and System Security
    File extension changed: how can I recover my files that changed to .mado extension? is there any easy idea my all files are encrypted as .mado . How to decrypt ? https://answers.microsoft.com/en-us/protect/forum/all/file-extension-changed/5eb5c4f3-acce-4907-9e10-857faaec0e1c
  6. How to Change PDF file icon to another icon

    in Windows 10 Network and Sharing
    How to Change PDF file icon to another icon: I have a Lenovo Ideapad S340 Laptop running Windows 10 and Microsoft programs. I downloaded the Lenovo User Guide for the S340. The icon for the user guide is PDF. I want to change this icon from PDF to Lenovo. I found the Lenovo icon in ico form and downloaded it to my...
  7. Date modified changed for thousands of files

    in Windows 10 Network and Sharing
    Date modified changed for thousands of files: Hi, On my Windows 10 laptop with a Samsung SSD I have experienced some weird behavior tonight: I have roughly 11.000 files with date modified "today" since I started the laptop in the afternoon. Many of these files are in tmp folders e.g. AppData/Local/Temp or in folders...
  8. Change file extension for Notepad ++

    in Windows 10 Software and Apps
    Change file extension for Notepad ++: Ran multiple searches and hard to believe this hasn't been covered but ... I need to find 'Change Program' in the list of file extensions under Default Programs>"Associate a file type or protocol". Thank you. P.S. Also if the site's search can't find Notepad ++ (with or...
  9. change file extension to open by another program

    in Windows 10 Customization
    change file extension to open by another program: i have a weird issue that randomly .xls will opens default with excel citrix. after one-off manual change to open by excel using GUI, it will be fine. how do i change it for all computers? i tried using command ftype Excel.Sheet.8="C:\Program Files\Microsoft...
  10. How to change a file extension

    in Windows 10 Network and Sharing
    How to change a file extension: How do I change a file extension or file type in windows 10? https://answers.microsoft.com/en-us/windows/forum/all/how-to-change-a-file-extension/f430aae6-5a42-4b76-b2f4-f45a21f6c8a8"