customize file associations, to open files in custom default handler apps
-
searchmaxxer
- Posts: 8
- Joined: Wed May 14, 2025 4:56 am
customize file associations, to open files in custom default handler apps
(I apologize if this has been answered before. I looked quite thoroughly and couldn't find a similar thread. If it has been answered before, please point me to the appropriate thread.)
I use a lot of portable apps, and have found the Windows 11 default file associations unreliable. E.g., I had set up Irfanview (in portable mode) to view images, but still, sometimes Windows 11 would use its native image viewer to display an image.
So I avoid setting Windows 11 file associations as much as possible. Instead, I use XYPlorer (in portable mode) as my "File Explorer", and use its internal file association tool to set up file associations. So any file I open from within XYPlorer opens in exactly the handler app I want it to open in.
I see that Everything Search App's GUI doesn't seem to have a "customize file associations" tool.
I was wondering if there's some way I could still do it using a script or code.
The goal being that if I search for images (in Everything Search App), and am presented with result a list of images, and double click on an image, it opens in exactly the handler app I want it to open in (Irfanview portable, in the case of images).
Thank You.
I use a lot of portable apps, and have found the Windows 11 default file associations unreliable. E.g., I had set up Irfanview (in portable mode) to view images, but still, sometimes Windows 11 would use its native image viewer to display an image.
So I avoid setting Windows 11 file associations as much as possible. Instead, I use XYPlorer (in portable mode) as my "File Explorer", and use its internal file association tool to set up file associations. So any file I open from within XYPlorer opens in exactly the handler app I want it to open in.
I see that Everything Search App's GUI doesn't seem to have a "customize file associations" tool.
I was wondering if there's some way I could still do it using a script or code.
The goal being that if I search for images (in Everything Search App), and am presented with result a list of images, and double click on an image, it opens in exactly the handler app I want it to open in (Irfanview portable, in the case of images).
Thank You.
Re: customize file associations, to open files in custom default handler apps
Version 1.5 has a Custom open command.
Here you can set associations for extensions.
My config entry look like this
custom_open_commands=[{"name":"Open TC","type":2,"filter"="*.7z;*.zip;*.rar;*.aes;*.jpg;*.zpaq;*.EOC","command"="$exec(\"C:\\Tools\\Wincmd\\Totalcmd64.exe\" /a /o /s \"%1\")"},{"name":"Open AkelPad","type":2,"filter"="*.ini","command"="$exec(\"C:\\Tools\\AkelPad\\AkelPad.exe\" \"%1\")"}]
Use the context menu from a search result entry
to select the entry you want.
Here you can set associations for extensions.
My config entry look like this
custom_open_commands=[{"name":"Open TC","type":2,"filter"="*.7z;*.zip;*.rar;*.aes;*.jpg;*.zpaq;*.EOC","command"="$exec(\"C:\\Tools\\Wincmd\\Totalcmd64.exe\" /a /o /s \"%1\")"},{"name":"Open AkelPad","type":2,"filter"="*.ini","command"="$exec(\"C:\\Tools\\AkelPad\\AkelPad.exe\" \"%1\")"}]
Use the context menu from a search result entry
to select the entry you want.
-
searchmaxxer
- Posts: 8
- Joined: Wed May 14, 2025 4:56 am
Re: customize file associations, to open files in custom default handler apps
Thank you for responding.
I didn't understand this part:
How should I use it please? Thanks.

I didn't understand this part:
Below is the context menu I see when I right-click on a search result entry for the search query ".jpg".Use the context menu from a search result entry
to select the entry you want.
How should I use it please? Thanks.

Re: customize file associations, to open files in custom default handler apps
What this does, if I'm understanding correctly, is to add a (right-click) context-menu item (in this case, PIC) that opens particular file types (.jpg, .png, .ico), in a particular program (IrfanView).
. .
(You'd have to set up wanted file types & paths to your particular programs as they are on your end.)
Now you can also assign hotkeys to custom actions.
Like here, I've set Alt+H to open files in my Hex editor.
You could do similar, say Alt+I to open IrfanView. So anytime you're on a file type that IrfanView can handle, hit Alt+I & it will open in IrfanView.
.
Now, I think you're wanting to simply hit a <CR> on a pic: file-type & have it open in IrfanView (regardless of system defined associations)?
(Heh. And if MS steals file type associations, complain to MS
.)
. .
(You'd have to set up wanted file types & paths to your particular programs as they are on your end.)
Now you can also assign hotkeys to custom actions.
Like here, I've set Alt+H to open files in my Hex editor.
You could do similar, say Alt+I to open IrfanView. So anytime you're on a file type that IrfanView can handle, hit Alt+I & it will open in IrfanView.
.
Now, I think you're wanting to simply hit a <CR> on a pic: file-type & have it open in IrfanView (regardless of system defined associations)?
(Heh. And if MS steals file type associations, complain to MS
Re: customize file associations, to open files in custom default handler apps
As an example, to open jpg files with mspaint:
include_folders == don't include folders.
include_files == include files only.
filter == match jpg files (*.jpg)
command ==
Adjust the command to execute Irfanview.
Custom Open Commands
- In Everything 1.5, from the Tools menu, click Options.
- Click the Advanced tab on the left.
- To the right of Show settings containing, search for:
open - Select: custom_open_commands
- Set the value to:
[{"name":"","description":"","include_folders":false,"include_files":true,"filter":"*.jpg","command":"$exec(\"%SYSTEMROOT%\\system32\\mspaint.exe\" \"%1\")"}]
Click the Edit button to view the JSON table editor. - Click OK.
include_folders == don't include folders.
include_files == include files only.
filter == match jpg files (*.jpg)
command ==
$exec("%SYSTEMROOT%\system32\mspaint.exe" "%1")Adjust the command to execute Irfanview.
Custom Open Commands
-
searchmaxxer
- Posts: 8
- Joined: Wed May 14, 2025 4:56 am
Re: customize file associations, to open files in custom default handler apps
Thank You!therube wrote: Tue Jul 08, 2025 4:31 pm What this does, if I'm understanding correctly, is to add a (right-click) context-menu item (in this case, PIC) that opens.......
-
searchmaxxer
- Posts: 8
- Joined: Wed May 14, 2025 4:56 am
-
searchmaxxer
- Posts: 8
- Joined: Wed May 14, 2025 4:56 am
Re: customize file associations, to open files in custom default handler apps
Just posting for future reference.
I had to work with a lot of AI's to get it working for my specific case because I was using Portable Irfanview, and not an installed version. Ultimately, Claude Sonnet 4 came through and gave me what worked:
The issue was that there are a lot of spaces in my folder and file names, and they caused issues.
Thank you all!!!
I had to work with a lot of AI's to get it working for my specific case because I was using Portable Irfanview, and not an installed version. Ultimately, Claude Sonnet 4 came through and gave me what worked:
Code: Select all
[{"name":"IrfanView Portable","description":"Open with IrfanView Portable","include_folders":false,"include_files":true,"filter":"*.jpg;.png;.ico;.bmp;.webp","command":"$exec(C:\\Users\\windows.username\\Desktop\\portable\\IMAGES~1\\IRFANV~1\\IrfanViewPortable.exe %1)"}]Thank you all!!!
Last edited by searchmaxxer on Thu Aug 07, 2025 4:17 am, edited 1 time in total.
-
searchmaxxer
- Posts: 8
- Joined: Wed May 14, 2025 4:56 am
Re: customize file associations, to open files in custom default handler apps
I have a question about how to translate the working version that Claude Sonnet 4 provided (with short names) into a version containing long names with spaces?
I ran into an issue related to 2 things:
1) I use the portable version of Irfanview, so it is not available via "system32\etc. etc."
2) I have many spaces in the path to portable Irfanview.
The path to Irfanview is:
Claude Sonnet 4 was able to give me something that works using shortnames (8.3 DOS style names):
This works.
However the best that Google Gemini could do was this:
This doesn't work. Google Gemini claims that "the custom_open_commands parser has a fundamental issue with handling quoted paths that contain spaces, causing it to pass the quote character literally to Windows instead of using it to delimit the path".
My question to y'all: Is it possible to translate the working version that Claude Sonnet 4 provided (with short names) into a version containing long names with spaces?
I ran into an issue related to 2 things:
1) I use the portable version of Irfanview, so it is not available via "system32\etc. etc."
2) I have many spaces in the path to portable Irfanview.
The path to Irfanview is:
Code: Select all
"C:\Users\user.name\Desktop\portable\images pics photos\IrfanViewPortable (image viewer)\IrfanViewPortable.exe"Code: Select all
[{"name":"IrfanView Portable","description":"Open with IrfanView Portable","include_folders":false,"include_files":true,"filter":"*.jpg;.png;.ico;.bmp;.webp;.gif","command":"$exec(C:\\Users\\user.name\\Desktop\\portable\\IMAGES~1\\IRFANV~1\\IrfanViewPortable.exe %1)"}]However the best that Google Gemini could do was this:
Code: Select all
[{"name":"Open with IrfanView","description":"Opens the selected file in IrfanView Portable","include_folders":false,"include_files":true,"filter":"*.jpg;*.png;.ico;.bmp;.webp","command":"$exec(\"C:\\Users\\user.name\\Desktop\\portable\\images pics photos\\IrfanViewPortable (image viewer)\\IrfanViewPortable.exe\" \"$fullfilename(1)\")"}]My question to y'all: Is it possible to translate the working version that Claude Sonnet 4 provided (with short names) into a version containing long names with spaces?
Last edited by searchmaxxer on Thu Aug 07, 2025 4:18 am, edited 1 time in total.
Re: customize file associations, to open files in custom default handler apps
2searchmaxxer
Hi,
try this solution...ย ย ย ย user.name -> please adjust...
[{"name":"IrfanView Portable","description":"Open with IrfanView Portable","include_folders":false,"include_files":true,"filter":"*.jpg;*.png;*.ico;*.bmp;*.webp","command":"$exec(\"C:\\Users\\user.name\\Desktop\\portable\\images pics photos\\IrfanViewPortable (image viewer)\\IrfanViewPortable.exe\" \"%1\")"}]
Hi,
try this solution...ย ย ย ย user.name -> please adjust...
Code: Select all
[{"name":"IrfanView Portable","description":"Open with IrfanView Portable","include_folders":false,"include_files":true,"filter":"*.jpg;*.png;*.ico;*.bmp;*.webp","command":"$exec(\"C:\\Users\\user.name\\Desktop\\portable\\images pics photos\\IrfanViewPortable (image viewer)\\IrfanViewPortable.exe\" \"%1\")"}]Re: customize file associations, to open files in custom default handler apps
Note that in the Edit dialog itself you don't need to \\ the \'s nor escape the ", directly.
You can simply write out a path, "normally", so simply:
Now if the path includes spaces, then you do need to quote it:
and Everything itself "translates" that to what it needs, doubling the \'s & adding the escaping:
(Or, you could do the doubling & escaping, manually
.)
Also note that 8.3 are not necessarily "consistent".
While the given, \\IMAGES~1\\IRFANV~1\\, may have happened to work for you,
It just as well could have been that you would have had to use something like, \\IMAGES~2\\IRFANV~3\\ - depending.
(DIR /X /AD <PATH> would show you the SFN.)
(There are other "gotcha's" with 8.3's.)
You can simply write out a path, "normally", so simply:
C:\Users\user.name\Desktop\portable\images pics photos\IrfanViewPortable (image viewer)\IrfanViewPortable.exeNow if the path includes spaces, then you do need to quote it:
"C:\Users\user.name\Desktop\portable\images pics photos\IrfanViewPortable (image viewer)\IrfanViewPortable.exe"and Everything itself "translates" that to what it needs, doubling the \'s & adding the escaping:
\"C:\\Users\\user.name\\Desktop\\portable\\images pics photos\\IrfanViewPortable (image viewer)\\IrfanViewPortable.exe\"(Or, you could do the doubling & escaping, manually
Also note that 8.3 are not necessarily "consistent".
While the given, \\IMAGES~1\\IRFANV~1\\, may have happened to work for you,
It just as well could have been that you would have had to use something like, \\IMAGES~2\\IRFANV~3\\ - depending.
(DIR /X /AD <PATH> would show you the SFN.)
(There are other "gotcha's" with 8.3's.)
-
searchmaxxer
- Posts: 8
- Joined: Wed May 14, 2025 4:56 am
Re: customize file associations, to open files in custom default handler apps
Holy smokes, you were right... just using the full path with spaces enclosed in double quotes worked!!
Thank you!!