show and sort subfolder

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
foxdon
Junior Member
Junior Member
Posts: 14
Joined: 2013-10-16, 06:53 UTC

show and sort subfolder

Post by *foxdon »

Hi,
is any possibility how to show/find and sort subfolders by name (depth 1)?

Example:
\2010\folder A
\2010\folder E
\2011\folder C
\2012\folder B
\2012\folder D

I need such result:
\2010\folder A (or \folder A only)
\2012\folder B
\2011\folder C....

Thank you very much!
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Re: show and sort subfolder

Post by *tuska »

If you used Everything, there'd be a simple solution:
https://www.bilder-hochladen.net/files/lwdu-11-9482.png

Code: Select all

"Path" folder: parents:3
Button in TC:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Tools\Everything\Everything-portabel\Everything.exe -parentpath
%V
%COMMANDER_PATH%\Tools\Everything\Everything-portabel\Everything.exe
OPEN parent path (including subdirectories) of TC in Everything (-parentpath)|ONLY current directory OR root directory|http://www.voidtools.com/support/everything/command_line_options/|http://www.voidtools.com/support/everything/searching/
%COMMANDER_PATH%\Tools\Everything\Everything-portabel\
0
-1
Mark the whole code, Ctrl+C and then right click on free space in your buttonbar, Ctrl+V -> create button in TC.
The path to Everything.exe still has to be adjusted.

In the example the directory "D:\zTEST\" was active in TC and then the button was pressed in TC.
Directly in "Everything" the parameters as shown in the picture have to be added in the input line.

With certain settings in Everything, the folders or files from Everything can be opened in Total Commander.

Regards
Karl
User avatar
obeg
Junior Member
Junior Member
Posts: 43
Joined: 2006-09-28, 09:20 UTC
Location: Sweden

Re: show and sort subfolder

Post by *obeg »

Hi

It can be done with a search and Custom Columns, but feels rather awkward. Hopefully someone have a better way.

Do a search for files (Alt+F7), specify "Search in subdirectories" = 1 level(s) on general tab and check attribute "Directory" on advanced tab. Do the search and feed result to listbox.

Create a Custom Column, that contains two additional fields:
Caption= Folder, Filed contents= [=tc.name]
Caption= Path, Filed contents= [=tc.path]

Then you switch to that view mode and can sort by clicking on the column named "Folder"

br/
foxdon
Junior Member
Junior Member
Posts: 14
Joined: 2013-10-16, 06:53 UTC

Re: show and sort subfolder

Post by *foxdon »

Thank you both!
@*tuska - unfortunately not suitable for me - company SW rules

@*obeg - it works correctly.
Just note for other users: it is necessary to select "options -> display -> sorting directories -> like files".
Only problem is if you go into the selected subfolder you have to repeat the search procedure...If you have any idea how to "keep the results" it will be helpful for me.
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Re: show and sort subfolder

Post by *tuska »

foxdon wrote: 2018-09-11, 13:33 UTC If you have any idea how to "keep the results" it will be helpful for me.
After "Feed to listbox", press CTRL+T --> tab "Search result:" appears
(Help (F1) - Keyboard: CTRL+T Open new folder tab and activate it)

For further information/possibilities:
- cm_CommandBrowser <enter> ... <-- Input in TC command line
- Filter: tab
foxdon
Junior Member
Junior Member
Posts: 14
Joined: 2013-10-16, 06:53 UTC

Re: show and sort subfolder

Post by *foxdon »

tuska wrote: 2018-09-11, 15:14 UTC
foxdon wrote: 2018-09-11, 13:33 UTC If you have any idea how to "keep the results" it will be helpful for me.
After "Feed to listbox", press CTRL+T --> tab "Search result:" appears
(Help (F1) - Keyboard: CTRL+T Open new folder tab and activate it)

For further information/possibilities:
- cm_CommandBrowser <enter> ... <-- Input in TC command line
- Filter: tab
Very good idea! Thank you again.

Additional question. Is there way how to prepare "script" for searching with predefined "saved" parameters? For "one click" searching via icon.
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Re: show and sort subfolder

Post by *tuska »

foxdon wrote: 2018-09-12, 05:32 UTC Is there way how to prepare "script" for searching with predefined "saved" parameters? For "one click" searching via icon.
You can save your search with criteria, e.g. under name "Folder_Level_1" ... ALT+SHIFT+F7 (Find Files) -> Load/Save
Try to leave the field "Search in:" empty or look for the path in the field "Search in:" later.

Then simply create a button with the command: LOADSEARCH Folder_Level_1.
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Re: show and sort subfolder

Post by *tuska »

EDIT: Please consider this point to be irrelevant - see important statements at the bottom...
tuska wrote: 2018-09-12, 08:04 UTC Try to leave the field "Search in:" empty or look for the path in the field "Search in:" later.
You can also do the following about that:
Add the following text to the file usercmd.ini at the end:

Code: Select all

[em_Search_Directory_level_1]
button=wcmicons.dll,47
cmd=%COMMANDER_EXE%
param=/S=F:LFolder_Level_1
menu=%COMMANDER_EXE% /S=F:LFolder_Level_1
Create a button with command:

Code: Select all

cm_CopySrcPathToClip,em_Search_Directory_level_1
Explanation:
1. When you press the button the current path in TC will be saved in the clipboard (cm_CopySrcPathToClip)
2. Your saved search (Folder_Level_1) is called in a separate TC window (em_Search_Directory_level_1);
3. if you press the TAB key once and then Ctrl+V the path from the clipboard will be inserted
---
4. For this purpose an em_command was created: em_Search_Directory_level_1
4a Command: %COMMANDER_EXE%
4b Parameters: /S=F:LFolder_Level_1
4c Icond file: wcmicons.dll, Icon: 47
4d Tooltip: %COMMANDER_EXE% /S=F:LFolder_Level_1
5. The internal command cm_CopySrcPathToClip has been combined with the internal instruction em_Search_Directory_level_1 (-> Button)
---------------------------------------------------------------------------------------------------------------------------------
EDIT (1+2):
On this point I posted a question in the german forum and got the following answer:
Dalai wrote:So far I have never had a problem with saved searches and an empty field "Search in:" (I have been doing this for many years).
If in doubt, you can simply enter a dot in the "Search in:" field that stands for the current directory. /// --> please note the answer below of Mr. Ghisler! ...
Author of Total Commander wrote:Please leave the field "Search in:" empty! TC then searches in the directory of the active file window.
If you specify a dot, the search will be done in the last set current directory - this may be different depending on the previous file operation.
Please therefore consider this point to be irrelevant.
(A button with command: LOADSEARCH Folder_Level_1 <field "Search in:" empty> completely serves its purpose in this case).
---------------------------------------------------------------------------------------------------------------------------------
Last edited by tuska on 2018-09-12, 20:15 UTC, edited 2 times in total.
foxdon
Junior Member
Junior Member
Posts: 14
Joined: 2013-10-16, 06:53 UTC

Re: show and sort subfolder

Post by *foxdon »

tuska wrote: 2018-09-12, 08:04 UTC
foxdon wrote: 2018-09-12, 05:32 UTC Is there way how to prepare "script" for searching with predefined "saved" parameters? For "one click" searching via icon.
You can save your search with criteria, e.g. under name "Folder_Level_1" ... ALT+SHIFT+F7 (Find Files) -> Load/Save
Try to leave the field "Search in:" empty or look for the path in the field "Search in:" later.

Then simply create a button with the command: LOADSEARCH Folder_Level_1.
Perfect "LOADSEARCH" is the right command I didn't know.
Thank you, I appreciate your support.
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Re: show and sort subfolder

Post by *tuska »

An important addition/statement by Mr. Ghisler in the german forum has been added above to this forum post (please see: EDIT 1+2).
This concerns the path specified in the "Search in:" field (in the "Find Files" window of TC).
Post Reply