Sorry the question is longer than usual, but the shorter version would probably just close again because of a false "duplicate" stamp .
With "default action" Is meant the double click on a file in windows explorer or the click to the bolded action in the context menu of a file. "Default action" is not to be confused with "default app".
When I mention Notepad++ and .txt files it is only meant as an example. It is not a special solution for this searched but a general, which can be applied to each app and each file.
- This is not a duplicate to How to change default action for file types? because the question is over 10 yeas old and the answers are not the answers to my question and a lot has changed since then.
- This is not a duplicate to How can I make Notepad++ default program for
.txtfiles? because, I don't want a solution only for Notepad++ and I don't want to change the default app! - This is also not a duplicate to any question or answer to How to change the default app. because change the default app will change more as only the default action
- if someone comes up with a better title, I'm open to suggestions.
I want to change the default action, but I have found that changing the default application is not the solution to this because changing the default application will:
- change the icon
- change the context menu action
- change the "open with "suggestions
- change "send to"
- etc. ... short: it will change too much
In older windows versions you simply searched the registry for the extension (.txt) then the default entry (txtfile) and created or changed shell/open/command.
But this seems not to work in Windows 11 (at least not everywhere). Sometimes the entry does not exist, sometimes it is ignored.
BTW: what new registry keys do I need to know?
Shows that the "assign default app" is not the solution:
- create a new file "test.specialtxt"
- add Computer\HKEY_CLASSES_ROOT.specialtxt@default=specialtxtfile
- add specialtxtfile structure: shell/open/command + shell/special/command
- Test in Explorer that the context menu items "open" and "special" appear
- assign Notepad as default app. (open with... always)
- "open" and "special" disappear
- assign Notepadd++ as default app.
- still "open" and "special" disappear
- now specialtxt_auto_file is assigned to .specialtxt
Computer\HKEY_CLASSES_ROOT.specialtxt@default=specialtxt_auto_file
So what can I do to change the default action without changing other things?