I have a couple of custom file associations which I use to encrypt and decrypt any file. After encryption the file extension changes to .xyz but the encrypt option still shows up in the custom menu. Is it possible to exclude .xyz from the encrypt option so that it does not show up on encrypted files? I tried using the following without success:
*;-xyz
*;xyz.
How to exclude extension from custom file association
-
StewCam
- Posts: 6
- Joined: 01 Jun 2013 03:55
-
RalphM
- Posts: 2143
- Joined: 27 Jan 2005 23:38
- Location: Cairns, Australia
Re: How to exclude extension from custom file association
Use *;!xyz instead, "!" = not.
Ralph 
(OS: W11 26H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)
(OS: W11 26H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)
-
jupe
- Posts: 3570
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
Re: How to exclude extension from custom file association
While this would be a nice feature (and I have wanted to do the same myself in the past), what RalphM describes doesn't exist, it isn't possible.
As a workaround I would suggest creating 1 CFI entry and make it load a script that performs a decrypt if it is a xyz file otherwise encrypt instead, and name it eg. "En/Decrypt"
As a workaround I would suggest creating 1 CFI entry and make it load a script that performs a decrypt if it is a xyz file otherwise encrypt instead, and name it eg. "En/Decrypt"
-
StewCam
- Posts: 6
- Joined: 01 Jun 2013 03:55
Re: How to exclude extension from custom file association
@RalphM - thanks for the suggestion but it seems that *;!xyz does not work (* overrides !).
@jupe - thanks also for proposed workaround - I will try with a script.
@jupe - thanks also for proposed workaround - I will try with a script.
-
RalphM
- Posts: 2143
- Joined: 27 Jan 2005 23:38
- Location: Cairns, Australia
Re: How to exclude extension from custom file association
While my example doesn't work in combination with *, one could list all available extensions and then either just omit the "xys" or add it as "!xys" (I agree not very user-friendly).
I tested it with one of my image resizing CFA's and it worked to exclude one of the extensions by stating "jpg;jpeg;!png", which made this CFA only show for jpg and jpeg's.
I tested it with one of my image resizing CFA's and it worked to exclude one of the extensions by stating "jpg;jpeg;!png", which made this CFA only show for jpg and jpeg's.
Ralph 
(OS: W11 26H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)
(OS: W11 26H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: How to exclude extension from custom file association
! has no special function in this context. Create a file with "!png" as extension and it will match your definition...
FAQ | XY News RSS | XY X
-
RalphM
- Posts: 2143
- Joined: 27 Jan 2005 23:38
- Location: Cairns, Australia
Re: How to exclude extension from custom file association
If that is true, why does the following CFA show up for jpg and jpeg but not png?
Code: Select all
|"IrfanView /resize_long=2000" jpg;jpeg;!png>::foreach ($item, <pfaitems>) {run """C:\Program Files (x86)\IrfanView\i_view32.exe"" $item ""/resize_long=2000 /aspectratio /resample /convert=$N_sml$O /makecopy"""}Ralph 
(OS: W11 26H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)
(OS: W11 26H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: How to exclude extension from custom file association
Because png is not listed among the extensions.
FAQ | XY News RSS | XY X
XYplorer Beta Club