Menu Show - Only selcted files

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Duke
Junior Member
Junior Member
Posts: 56
Joined: 2003-11-19, 18:57 UTC

Menu Show - Only selcted files

Post by *Duke »

TC 11.51 64-bit in Windows 11

I select a few files and choose in the menu View "Only selcted files". This works without any problems. When I go back to the menu View menu, in menu is mark "All Files"?

If i minimze TC and show the TC window again, the directory will reload and View "Only selcted files" gone, all files show?
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Menu Show - Only selcted files

Post by *Fla$her »

It's by design. This is a quick filtering, not full-fledged.
For a full-fledged one, you can use this button:

Code: Select all

TOTALCMD#BAR#DATA
cd
 %S|*\
wcmicon2.dll,13
Show only selected files
Last edited by Fla$her on 2025-04-10, 16:55 UTC, edited 1 time in total.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Menu Show - Only selcted files

Post by *petermad »

Code: Select all

cd
%S|*\
Notice that this will only works is the file names selected, including a space between each file and quotation marks around filenames with spaces is less than 1018 bytes long
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Menu Show - Only selcted files

Post by *Fla$her »

2petermad
Spaces? 1018? Give me an example. I don't understand what this is about.
Overquoting is evil! 👎
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Menu Show - Only selcted files

Post by *sa16 »

Fla$her wrote:Give me an example.
With 10 files with a length of 100 characters, the button works, with 11 - no.
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Menu Show - Only selcted files

Post by *Fla$her »

sa16 wrote: 2025-04-10, 16:06 UTC With 10 files with a length of 100 characters, the button works, with 11 - no.
OK. Then why don't we see such notes regarding other similar solutions?
Overquoting is evil! 👎
User avatar
white
Power Member
Power Member
Posts: 5744
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Menu Show - Only selcted files

Post by *white »

Code: Select all

cd
%S|*\
This doesn't work if the first selected filename contains a space. For some reason if there is no space after the command "cd" or before the parameter %S, quotes around the first filename get lost when the cd command is executed by TC. Looks like a bug.

Edit:
Bug report created.
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Menu Show - Only selcted files

Post by *Fla$her »

Yes, this is a bug. Added a space before %S.
Overquoting is evil! 👎
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Menu Show - Only selcted files

Post by *sa16 »

Fla$her wrote:Then why don't we see such notes regarding other similar solutions?
There is more size:
History.txt wrote:22.10.19 Added: SELECTFILES command: Support list up to 32767 characters long,
Fla$her
Power Member
Power Member
Posts: 2982
Joined: 2020-01-18, 04:03 UTC

Re: Menu Show - Only selcted files

Post by *Fla$her »

It would be wise to bring all commands with parameters to a common limitation.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Menu Show - Only selcted files

Post by *petermad »

I have been using: %Z%Y*\ %S for years in my Extended Menus - works fine.

IIRC the 1018 limit is because filters made with the cd command is limited to 1018 bytes.

See also: https://ghisler.ch/board/viewtopic.php?p=361382#p361382
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Menu Show - Only selcted files

Post by *sa16 »

2petermad
Typo: %Z%Y*\ %S
User avatar
petermad
Power Member
Power Member
Posts: 15997
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Menu Show - Only selcted files

Post by *petermad »

Typo: %Z%Y*\ %S
Thanks - I have now corrected it here above

While we are at typos - the filter length limit is not 1081 bytes it is 1018 - I have corrected it here above too.

I believe the restriction has to do with the length of the input field in the Custom mask (Ctrl+F12).
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Duke
Junior Member
Junior Member
Posts: 56
Joined: 2003-11-19, 18:57 UTC

Re: Menu Show - Only selcted files

Post by *Duke »

Thanks for the workaround!
sa16
Senior Member
Senior Member
Posts: 324
Joined: 2021-09-10, 07:15 UTC

Re: Menu Show - Only selcted files

Post by *sa16 »

2Duke
Sometimes, instead of the cm_ShowOnlySelected command, it is convenient to use the cm_DirBranchSel (Ctrl+Shift+B) command.
You can also use Ctrl+Shift+B to return to showing all files (or programs, or files with the latest user-defined specification).
Post Reply