DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Is there any way of 'saving' file associations?  (Read 15,913 times)

dcsev

  • Participant
  • Joined in 2009
  • *
  • Posts: 182
Is there any way of 'saving' file associations?
« on: March 24, 2015, 10:56 PM »
Hi all,
This problem has been following me for a long time. Is there any way to 'save' file associations in Windows 8.1 to a .reg file?  For example, .txt is to notepad. I have many file associations I would like to save so I don't have to keep re-associating after Windows reinstall.  I would just run all of the reg files on reinstall and not have to do them manually by hand. I have tried all of the programs listed in portable freeware, donation coder, and google search for hours and have yet to find something that does this.

I do use 'portable file associations' in XYplorer, but I really want to be able to have the file association in Windows option.

Is this possible?

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: Is there any way of 'saving' file associations?
« Reply #1 on: March 24, 2015, 11:18 PM »
Use DISM.exe to export/import file associations - see here.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

dcsev

  • Participant
  • Joined in 2009
  • *
  • Posts: 182
Re: Is there any way of 'saving' file associations?
« Reply #2 on: March 25, 2015, 05:22 AM »
Wow, are you kidding me.

It can't be that easy. All this time I have been looking to external solutions.

Unfortunately, I won't be able to know if it truly worked until I reinstall, but THANK YOU for the info!!

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: Is there any way of 'saving' file associations?
« Reply #3 on: March 25, 2015, 11:14 AM »
Unfortunately, I won't be able to know if it truly worked until I reinstall, but THANK YOU for the info!!

Edit the XML file to change the default program for a filetype, (make a backup first), for example:

Code: (xml)
<Association Identifier=".nfo" ProgId="Applications\notepad.exe" ApplicationName="Notepad" />

Will redirect *.nfo files to be opened in Notepad rather than SystemInfo.

Then import using DISM, log out then in and see what happens when you open a .nfo file.

If an extension doesn't appear in the XML file it probably means that it is set to the default as when Windows was installed, (eg. .txt doesn't appear in my exported file because it still points to Notepad, even though Notepad itself has been replaced by Notepad2).
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

dcsev

  • Participant
  • Joined in 2009
  • *
  • Posts: 182
Re: Is there any way of 'saving' file associations?
« Reply #4 on: March 25, 2015, 02:37 PM »
I see one potential problem so far. If the app itself associates itself with the registry the DISM app doesn't add the location of the application to the "ProgID".  When I export and import again on a fresh install one would reasonably assume it would know to open INI with Notepad++ but wouldn't know where N++ is.

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
Re: Is there any way of 'saving' file associations?
« Reply #5 on: March 25, 2015, 05:22 PM »
I see one potential problem so far. If the app itself associates itself with the registry the DISM app doesn't add the location of the application to the "ProgID".  When I export and import again on a fresh install one would reasonably assume it would know to open INI with Notepad++ but wouldn't know where N++ is.

You could try ERUNT

But I would make a registry save of your new install before copying a saved ERUNT reg save over it.
It comes with a readme with lots of info.  There may be a way to limit the save to HKCR or a way to save HKCR by itself.  I haven't read up on file associations in a long time.  Back when I wrote an Explorer Shell Extension they didn't have both global and user association sets.  They changed it since in the old days often uninstalling a program left a "hole" in the file type associations.


Edit: also see this:
http://www.sevenforums.com/backup-restore/212109-how-backup-windows-7-default-customized-file-associations.html

Edit2: I see what you mean about the  value just being the exe filename with no path.

« Last Edit: March 25, 2015, 05:36 PM by MilesAhead »

Vurbal

  • Mostly harmless
  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 653
    • Writer
Re: Is there any way of 'saving' file associations?
« Reply #6 on: March 25, 2015, 07:13 PM »
I would think the simplest and most effective way to do this would be using the command line file association tools - ftype and assoc.

There's a tutorial here for backing them up and restoring them from the command line. I haven't tried it myself, but it seems sound at a glance.
I learned to say the pledge of allegiance
Before they beat me bloody down at the station
They haven't got a word out of me since
I got a billion years probation
- The MC5

Follow the path of the unsafe, independent thinker. Expose your ideas to the danger of controversy. Speak your mind and fear less the label of ''crackpot'' than the stigma of conformity.
- Thomas J. Watson, Sr

It's not rocket surgery.
- Me


I recommend reading through my Bio before responding to any of my posts. It could save both of us a lot of time and frustration.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: Is there any way of 'saving' file associations?
« Reply #7 on: March 25, 2015, 07:22 PM »
I see one potential problem so far. If the app itself associates itself with the registry the DISM app doesn't add the location of the application to the "ProgID".  When I export and import again on a fresh install one would reasonably assume it would know to open INI with Notepad++ but wouldn't know where N++ is.

If you're not going to reinstall the programs associated with the relevant filetypes why are you saving the filetypes?
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

dcsev

  • Participant
  • Joined in 2009
  • *
  • Posts: 182
Re: Is there any way of 'saving' file associations?
« Reply #8 on: March 26, 2015, 12:54 AM »
4wd,
I don't reinstall 95% of my apps. They are all portable.  Some examples are Zoomplayer, Xnview, Notepad++.  That is my predicament. I would like to be able to easily get my file associations back on my portable apps.

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,954
Re: Is there any way of 'saving' file associations?
« Reply #9 on: March 26, 2015, 02:22 AM »
A search on the DC forum resulted in this N.A.N.Y entry. And it is my guess that it will help you out, especially with your preference of using portable software. Of course, this tool is portable as well.  ;)
The easy path is usually downhill...

dcsev

  • Participant
  • Joined in 2009
  • *
  • Posts: 182
Re: Is there any way of 'saving' file associations?
« Reply #10 on: March 26, 2015, 08:13 AM »
Shades, that was the first thing I tried. It didn't work for me unfortunately.  I think I even posted in the thread for help.

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,970
    • Gathering Badge
    • Participated in NANY Challenge Once
Re: Is there any way of 'saving' file associations?
« Reply #11 on: March 26, 2015, 09:57 AM »
Shades, that was the first thing I tried. It didn't work for me unfortunately.  I think I even posted in the thread for help.

I think you might have missed the update the author made for you ?

Okay a new version is up check first post for download link.

Also stisev sorry I couldn't get to it sooner cause of my sickness I would appreciate if you report back on it so I know it is fixed/I still got to track it down.

I finally ate more than I have been since Monday tonight, so I felt somewhat like poking in my code to hopefully find/fix it. :)
Tom
« Last Edit: March 26, 2015, 10:12 AM by tomos »

Original address: https://www.donationcoder.com/forum/index.php?topic=40515.0