Page 1 of 1

How to exclude extension from custom file association

Posted: 29 Jul 2021 04:13
by StewCam
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.

Re: How to exclude extension from custom file association

Posted: 29 Jul 2021 05:12
by RalphM
Use *;!xyz instead, "!" = not.

Re: How to exclude extension from custom file association

Posted: 29 Jul 2021 07:05
by jupe
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"

Re: How to exclude extension from custom file association

Posted: 29 Jul 2021 07:25
by StewCam
@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.

Re: How to exclude extension from custom file association

Posted: 29 Jul 2021 09:10
by RalphM
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.

Re: How to exclude extension from custom file association

Posted: 29 Jul 2021 09:36
by admin
! has no special function in this context. Create a file with "!png" as extension and it will match your definition...

Re: How to exclude extension from custom file association

Posted: 29 Jul 2021 10:49
by RalphM
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"""}

Re: How to exclude extension from custom file association

Posted: 29 Jul 2021 11:04
by admin
Because png is not listed among the extensions.