Files associations in Windows 10 (the double-click problem)

Discuss anything related to portable freeware here.
Message
Author
User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Files associations in Windows 10 (the double-click problem)

#1 Post by webfork »

Problem

One of the ways in which Windows 10 has been particularly unfriendly to portable software is via associations. The default applications menu under settings is bound and determined to get you to go through the Windows store or standard, installed software.

Win10 settings screen:
Image

Solutions

1. Open With

Steps:
  1. Right-click on the file in question and choose Open With ..
  2. Click More apps and scroll down to the bottom
  3. Click Look for another app on this pc and navigate to the program you want to use (or paste in the full path name)
Issues with this track: it's particularly tedious if you have multiple file types you want to specify on multiple computers.


2. Drag-and-drop onto the program icon/shortcut

Drag a given file onto the shortcut (drag the your program of choice to the desktop and hold Ctrl+Shift to easily create a program shortcut). I have this enabled with LibreOffice on my desktop.

Dragging an XLSX file onto the LibreOffice Shortcut
Image

Issues with this track: you have to minimize everything to clear your desktop to launch files.


3. Use the send-to menu

My current SendTo menu
Image

Create a simple batch file to open up the SendTo menu for your specific user by creating a text file with the following text:

Code: Select all

explorer %AppData%\Microsoft\Windows\SendTo
... then just rename the text file .bat and double-click. You'll get a view of all the items in your SendTo menu where you can drag-and-drop program shortcuts to (hold Ctrl+Shift to easily create program shortcuts). Re-run the batch file to come back to this same menu anytime you need to make changes.

Issues with this track: every time you open a file you have to right-click on it and goto a sub-menu. A few times a week (as I have for FileOptimizer) is fine, but it just gets tedious after the 5th or 6th time in a session.


4. Run an auto-association program like Coffee

Use a program that supersedes Windows own launching by file type. Despite it's age, my old program of choice Coffee still seems to run fine in Win10x64. Configuration of this program was addressed years ago in this thread.

Issues with this track: You have to build and maintain a program listing, and you can't change the file or folder locations. The program is ancient, no longer in development, and takes up 3 megs of RAM for something that I'm really frustrated isn't managed at an OS level.


5. CLI windows program / script (NOTE: I was never able to get this track to work.)

The best function I seemed to find here was something called SetUserFTA

Issues with this track: I could not for the life of me easily determine the ProgID, whatever the heck that is. The method for determining it via the assoc.exe didn't work for me, and I'm not sure it works for anyone.

----

Feedback welcome on this.

User avatar
lintalist
Posts: 434
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: Files associations in Windows 10 (the double-click problem)

#2 Post by lintalist »

6. Use a better file manager - e.g. anything but explorer :)

(Portable) file managers often provide various options to launch programs including:
* internal associations e.g. you can associate .docx with the portable version of libreoffice while from explorer it remains the installed Office application. So just hit enter or double click.
* button bars and (context) menus
* built-in "edit" hotkeys (the F4 in total commander can only have one editor, but there are options to have multiple) - or built-in options e.g. bmp=paint, jpg=photodemon etc such as in MultiCommander and no doubt others.

User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: Files associations in Windows 10 (the double-click problem)

#3 Post by webfork »

lintalist wrote: Sat Dec 12, 2020 2:56 pm 6. Use a better file manager - e.g. anything but explorer :)
Another good suggestion, thanks.

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: Files associations in Windows 10 (the double-click problem)

#4 Post by vevy »

Did you try reg files?

User avatar
rbon
Posts: 361
Joined: Wed Mar 28, 2007 2:16 am
Location: Italy

Re: Files associations in Windows 10 (the double-click problem)

#5 Post by rbon »

7. Use X-Cafè 4.0

X-Cafè is the 'official' tool of winPenPack to associate Portable Apps.
Links:
• X-Cafè [rev4] download page: http://www.winpenpack.com/en/download.php?view.1103
• X-Cafè [rev4] direct download from Sourceforge.net: https://sourceforge.net/projects/winpen ... p/download
• X-Cafè mini tutorial: http://www.winpenpack.com/main/page.php?42
• C.A.F.E. download page: http://www.winpenpack.com/en/download.php?view.1106

Remember:
The associations defined in 'X-Cafè' and 'C.A.F.E.' they are temporary and do not modify the registry in any way.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook.

User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: Files associations in Windows 10 (the double-click problem)

#6 Post by webfork »

vevy wrote: Sun Dec 13, 2020 7:10 am Did you try reg files?
I did not.
rbon wrote: Sun Dec 13, 2020 10:37 am 7. Use X-Cafè 4.0
Cafe and Coffee (mentioned above) are mostly the same program. I can't recall all the differences, but it's very similar code. But it's nice to see that they have something to integrate with a launcher program, I didn't know about that.

User avatar
lintalist
Posts: 434
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: Files associations in Windows 10 (the double-click problem)

#7 Post by lintalist »

8. Use a launcher
Many launchers allows you to define "open file with program" actions, similar to using a file manager but of course limited to starting programs and opening files. Some allow you to interact with the selected/"active" file(s) in Explorer.

User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: Files associations in Windows 10 (the double-click problem)

#8 Post by webfork »

lintalist wrote: Sun Dec 13, 2020 11:31 am 8. Use a launcher
Many launchers allows you to define "open file with program" actions, similar to using a file manager but of course limited to starting programs and opening files. Some allow you to interact with the selected/"active" file(s) in Explorer.
Any examples there?

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: Files associations in Windows 10 (the double-click problem)

#9 Post by vevy »

webfork wrote: Sun Dec 13, 2020 11:28 am
vevy wrote: Sun Dec 13, 2020 7:10 am Did you try reg files?
I did not.
They work fine if it weren't for MS's habit of resetting associations every once in a while or asking "Are you absolutely, positively, definitely sure you want to continue using your chosen app for this extension?"

They are also easy to reapply in such cases.

User avatar
webfork
Posts: 10818
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: Files associations in Windows 10 (the double-click problem)

#10 Post by webfork »

vevy wrote: Sun Dec 13, 2020 12:56 pm [Reg files] work fine if it weren't for MS's habit of resetting associations every once in a while or asking "Are you absolutely, positively, definitely sure you want to continue using your chosen app for this extension?"

They are also easy to reapply in such cases.
The only thing I could find on that was an XML file import export via the Dism tool over at woshub ... the registry edit function (discussed on the same page) seems to require the ProgID, which (as noted above) seems like a pain to determine.

How do you handle reg files for associations?

User avatar
lintalist
Posts: 434
Joined: Sat Apr 19, 2014 12:52 am
Contact:

Re: Files associations in Windows 10 (the double-click problem)

#11 Post by lintalist »

webfork wrote: Sun Dec 13, 2020 12:09 pmAny examples there?
I assume you refer to "selected files":
FARR can find and launch files, but also do much more. This AutoHotkey script template helps you use FARR to quickly take action on selected files in the active Explorer window. Similar to a context menu action in Explorer, but started from a FARR alias. - https://www.donationcoder.com/software/ ... -run-robot
(No doubt something similar could be added to Famulus if one wishes to code it, getting the selected files is relatively trivial in AHK)

Perhaps others too, wild guess would be listary "actions" - I'm not a launcher user (anymore) - Just a thought: I'm thinking if a launcher accepts "clipboard as argument" it might be as easy as press Ctrl+C in explorer, now the file paths are available in the clipboard (at least they are in AutoHotkey) so next start the launcher use the "open" command and use the clipboard (or press paste in case of one file) as argument.

User avatar
Cornflower
Posts: 244
Joined: Fri Aug 31, 2007 7:58 am
Location: Canada's capital

Re: Files associations in Windows 10 (the double-click problem)

#12 Post by Cornflower »

I found a freeware CLI program *after* my last Windows 10 updates, where I manually reset so many file associations to my portable apps.

SetUserFTA is designed specifically to solve this problem.

Steps.

1.
SetUserFTA get >configfile
This creates a text file with all the Microsoft private associations (not all your associations
2.
Edit the configfile with a text editor
Each line is in format
.extension, ProgID
The ProgID is deep inside teh Classes of the Registry, and can be in more than one spot, so this is handy

3.
Add or change any associations you want in the configfile
You can use paths to your applications, if you haven't associated anything with them yet

4.
SetUserFTA configfile
This will replace the MS Private associations

You can also do one-off associations from the command line without creating a configfile
SetUserFTA del .ext
SetUserFTA .ext ProgID

One more thing, it appears that you can edit where ftp, http, https, mailto etc. are directed. I haven't yet tested this functionality.


Website: https://kolbi.cz/blog/2017/10/25/setuse ... -per-user/

Download: https://kolbi.cz/SetUserFTA.zip

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: Files associations in Windows 10 (the double-click problem)

#13 Post by vevy »

webfork wrote: Mon Dec 14, 2020 9:53 am How do you handle reg files for associations?
For example, .txt. Use this reg file:

Code: Select all

[HKEY_CLASSES_ROOT\.txt\shell\open\command]
@="C:\\Path\\to\\myprogram.exe \"%1\""
Note:
  • You have to escape (put a backslash before) quotes and backslashes themselves anywhere inside the main quotes (@="").
  • Microsoft usually refers/redirects those to a different key under the same registry path.
    For example, if you open regedit to the key: HKEY_CLASSES_ROOT\.txt, you will see the value (Default) with the data txtfile.

    So you have to either (among other options):
    • set the open command under that key instead:

      Code: Select all

      [HKEY_CLASSES_ROOT\txtfile\shell\open\command]
    • delete that default value (unrecommended). Through a reg file (notice that the (Default) value of any key is referred to in reg files by "@"):

      Code: Select all

      [HKEY_CLASSES_ROOT\.txt\shell\open\command]
      @=-
      
      I wouldn't recommend the second option because:
      • it may complicate reverting things later if you don't remember the originals (always backup registry keys before modifying them).
      • some file types need certain other information to work properly. For example, engines that run executable script files (.js, .vbs, etc).
    So just backup and modify the referred (txtfile) open command instead of (.txt).
-----------------------------------------------------

Side note 1: if you don't want to enter the full path of your program with every file type (For example, the dozens of media files, text-based formats), you can use App Paths.

Code: Select all

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\myprogramalias.exe]
@="C:\\Path\\to\\myprogram.exe"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\myprogramalias.exe]
@="C:\\Path\\to\\myprogram.exe"
then just use myprogramalias.exe in the open commands e.g.

Code: Select all

[HKEY_CLASSES_ROOT\.txt\shell\open\command]
@=myprogramalias.exe \"%1\""
This way you'd have to change the actual path only twice (in the two App Paths keys) if you ever need to.

-----------------------------------------------------

Side note 2: You can also set the file icon regardless of the default open program:

Code: Select all

[HKEY_CLASSES_ROOT\txtfile\DefaultIcon]
@="C:\\Path\\to\\icon.ico"
Last edited by vevy on Wed Dec 16, 2020 12:16 pm, edited 1 time in total.

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: Files associations in Windows 10 (the double-click problem)

#14 Post by Midas »

Great tutorial there, vevy. Congrats. 8)

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: Files associations in Windows 10 (the double-click problem)

#15 Post by vevy »

Midas wrote: Wed Dec 16, 2020 6:01 am Great tutorial there, vevy. Congrats. 8)
Thanks!

Post Reply