Possible to start lister via commandline with a search value
Moderators: petermad, Stefan2, white, Hacker
Possible to start lister via commandline with a search value
I like working with total commander and lister a lot, I was wondering if its possible to start lister via the commandline with a search value applied (so you can hit F3 like the regular total commander find experience).
I found the link:
https://www.ghisler.com/lister/
but that does not specify posiblities for passing through a search value. Is it possible to do so?
I found the link:
https://www.ghisler.com/lister/
but that does not specify posiblities for passing through a search value. Is it possible to do so?
- ghisler(Author)
- Site Admin

- Posts: 51909
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Possible to start lister via commandline with a search value
No, unfortunately not. You could start Lister with its own wincmd.ini file and put the search value in the search history, then you could press F3 to search with that value.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Possible to start lister via commandline with a search value
What do you mean? RedirectSection?with its own wincmd.ini file
But the entry for key 0 in the [SearchText] section does not activate it for searching; it only replaces it in the combobox list.put the search value in the search history, then you could press F3 to search with that value.
Is it possible to send some kind of message to the TC window that would make the search value active in memory?
Overquoting is evil! 👎
Re: Possible to start lister via commandline with a search value
2ghisler(Author)
That does not seem to be correct, if I launch standalone Lister with the command line parameters:/i=path_to_ini_file /S=L path_to_file_to_open and then press F3 I will have to roll down the "Enter search text" combo box and choose the saved search string - it does NOT appear automatically in that combo box.and put the search value in the search history, then you could press F3 to search with that value.
License #524 1994
Danish TC Translator
TC 11.57b1 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1405a
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish TC Translator
TC 11.57b1 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1405a
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Possible to start lister via commandline with a search value
Any ini file, with this or any other name, used with the "/i=" option, containing the value desired in this situation under appropiate section and key.Fla$her wrote: 2026-02-06, 06:22 UTCWhat do you mean? RedirectSection?with its own wincmd.ini file
Re: Possible to start lister via commandline with a search value
From that answer it's difficult to understand that it's about /S=L. As far as I understand, in this case it doesn't matter whether /i is used or not, given the creation of a new process, since the necessary sections are reread, including from the main config. In this case, there is no need to call a separate process to set the last value; F3 (cm_List) is enough. The current value, as I already wrote, cannot be set using an ini.Gral wrote: 2026-02-07, 04:59 UTC used with the "/i=" option, containing the value desired in this situation under appropiate section and key.
Overquoting is evil! 👎
Re: Possible to start lister via commandline with a search value
2Stormer
I've tried a functional example technique as follows:
Explanation:
If you'd prefer to keep the temporary ini within the TotalCommander folder, change "$env:Temp" and "%Temp%" to "$env:commander_path" and "%commander_path%" respectively.
I've tried a functional example technique as follows:
- custom user command one (usercmd.ini), PowerShell-based:
Code: Select all
[em_get_f3_ini_from_clipboard] cmd=pwsh -c param=New-Item -path $env:Temp -name 'f3.ini' -type file -force -value ('[SearchText]'+[Environment]::NewLine+'0='+(Get-Clipboard))|Out-Null - custom user command two (usercmd.ini), TotalCommander native:
Code: Select all
[em_run_standalone_lister_with_f3_ini] cmd=%commander_exe% /i="%Temp%/f3.ini" param=/S=L %P%N - custom toolbar button with the said commands chain:
Code: Select all
TOTALCMD#BAR#DATA em_get_f3_ini_from_clipboard,em_run_standalone_lister_with_f3_ini WCMICON2.DLL run standalone lister with a predefined search query 0 -1
- Copy your search query to the clipboard (Ctrl+C)
- Place the cursor on the file in question
- Hit the button
- In the newly opened Lister's window, hit any key to enter find mode (F3|F5|F7).
- In the find mode pop-up window, choose your query from the drop-down list
- Proceed as needed
Explanation:
- [em_get_f3_ini_from_clipboard] command creates the brand new "f3.ini" file (in your %Temp% directory), with the only contents of the proper ini section ('[SearchText]'), and a single (initial) entry ('0=value'), where the 'value' is your search query that is retrieved from the clipboard
- [em_run_standalone_lister_with_f3_ini] command is self-explanatory; it just runs Lister with the file under the cursor and with the ready-to-use search query available in the drop-down list
If you'd prefer to keep the temporary ini within the TotalCommander folder, change "$env:Temp" and "%Temp%" to "$env:commander_path" and "%commander_path%" respectively.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Windows 11/Android 16
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Windows 11/Android 16
Re: Possible to start lister via commandline with a search value
2beb
And what does the clipboard have to do with it? It was written "with a search value applied", meaning a constant, so slow PowerShell isn't needed here. However, it's not needed anyway, since this can be done with a simple button:
But I don’t see any point in this, since nothing prevents you from using Ctrl+V instead of Down after opening the dialog. Why did such a strange idea even occur to you? 
The most logical thing would be to just open the search dialog right after F3, paste the necessary text, and execute it.
Button codes with TCFS2:
And what does the clipboard have to do with it? It was written "with a search value applied", meaning a constant, so slow PowerShell isn't needed here. However, it's not needed anyway, since this can be done with a simple button:
Code: Select all
TOTALCMD#BAR#DATA
%comspec% /q/u/c >"%COMMANDER_INI_PATH%\F3.ini" (echo [SearchText]&&echo 0^=%$CLIPNAME_NEQ1%)
wcmicon2.dll,67
Create F3.ini + clipboard text
1The most logical thing would be to just open the search dialog right after F3, paste the necessary text, and execute it.
Button codes with TCFS2:
For TC x32:
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef "tcm(2933,1) delay(50) eval(send_wait(^f,findwnd(TLister))) eval(settext_wait(`ANYTEXT`,findwnd(Edit,,findwnd(TMyComboBox,,findwnd(TSEARCHTEXT))))) sendmsg(findwnd(TButton,,findwnd(TSEARCHTEXT),2),$f5)"
wcmicon2.dll,27
Text viewing + auto-search for 'ANYTEXT' (TC x32)Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef "tcm(2933,1) delay(50) eval(send_wait(^f,findwnd(TLister))) eval(settext_wait(`%$CLIPNAME_NEQ1%`,findwnd(Edit,,findwnd(TMyComboBox,,findwnd(TSEARCHTEXT))))) sendmsg(findwnd(TButton,,findwnd(TSEARCHTEXT),2),$f5)"
wcmicon2.dll,45
Text viewing + auto-search for clipboard string (TC x32)For TC x64:
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef "tcm(2933,1) delay(50) eval(send_wait(^f,findwnd(TLister))) eval(settext_wait(`ANYTEXT`,findwnd(Edit,,findwnd(LCLComboBox,,findwnd(TSEARCHTEXT))))) sendmsg(findwnd(Button,,findwnd(TSEARCHTEXT),5),$f5)"
wcmicon2.dll,27
Text viewing + auto-search for 'ANYTEXT' (TC x64)Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef "tcm(2933,1) delay(50) eval(send_wait(^f,findwnd(TLister))) eval(settext_wait(`%$CLIPNAME_NEQ1%`,findwnd(Edit,,findwnd(LCLComboBox,,findwnd(TSEARCHTEXT))))) sendmsg(findwnd(Button,,findwnd(TSEARCHTEXT),5),$f5)"
wcmicon2.dll,45
Text viewing + auto-search for clipboard string (TC x64)Slightly less reliable solution for x32+x64:
Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef "set_tcini(Searchtext,0,`ANYTEXT`) tcm(2933,1) delay(50) eval(send_wait(^f,findwnd(TLister))) eval(send_wait({DOWN}{ENTER},findwnd(TSEARCHTEXT)))"
wcmicon2.dll,27
F3 + auto-search for 'ANYTEXT'Code: Select all
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\TCFS2\TCFS2.exe /ef "set_tcini(Searchtext,0,`%$CLIPNAME_NEQ1%`) tcm(2933,1) delay(50) eval(send_wait(^f,findwnd(TLister))) eval(send_wait({DOWN}{ENTER},findwnd(TSEARCHTEXT)))"
wcmicon2.dll,45
F3 + auto-search for clipboard stringOverquoting is evil! 👎
Re: Possible to start lister via commandline with a search value
Thanks guys for the extend answers, really appreciate it
Re: Possible to start lister via commandline with a search value
And would the trick with TCFS2 also work for outside total commander, say i want to open lister via Everything (voidtools) (with the searchvalue coming from the clipboard)
Re: Possible to start lister via commandline with a search value
No. TCFS2 is an addon. The feature of addons is that they only work with the program they were written for. For new processes, you'll have to use other automation tools, such as Autorun (with the AutorunLoadInSubprocess directive).
Overquoting is evil! 👎
Re: Possible to start lister via commandline with a search value
No need for this.Stormer wrote: 2026-02-12, 15:17 UTC And would the trick with TCFS2 also work for outside total commander, say i want to open lister via Everything (voidtools) (with the searchvalue coming from the clipboard)
You can define Custom commands in Everything which start TC Lister with the file from the search results.
Windows 11 Home, Version 25H2 (OS Build 26200.7922)
TC 11.57 beta2 x64 / x86
Everything 1.5.0.1406a (x64), Everything Toolbar 2.1.2, Listary Pro 6.3.6.99
QAP 12.2 x64
TC 11.57 beta2 x64 / x86
Everything 1.5.0.1406a (x64), Everything Toolbar 2.1.2, Listary Pro 6.3.6.99
QAP 12.2 x64
Re: Possible to start lister via commandline with a search value
would that also allow for passing the search value from the clipboard to lister?Horst.Epp wrote: 2026-02-12, 15:56 UTCNo need for this.Stormer wrote: 2026-02-12, 15:17 UTC And would the trick with TCFS2 also work for outside total commander, say i want to open lister via Everything (voidtools) (with the searchvalue coming from the clipboard)
You can define Custom commands in Everything which start TC Lister with the file from the search results.
Re: Possible to start lister via commandline with a search value
He needs to search not for a file, but for text within a file, using the built-in search dialog.
Overquoting is evil! 👎
Re: Possible to start lister via commandline with a search value
Why should I need that ?Stormer wrote: 2026-02-12, 15:59 UTCwould that also allow for passing the search value from the clipboard to lister?Horst.Epp wrote: 2026-02-12, 15:56 UTCNo need for this.Stormer wrote: 2026-02-12, 15:17 UTC And would the trick with TCFS2 also work for outside total commander, say i want to open lister via Everything (voidtools) (with the searchvalue coming from the clipboard)
You can define Custom commands in Everything which start TC Lister with the file from the search results.
I can search for a clipboard entry in Everything
and then view the results entry with TC.
Windows 11 Home, Version 25H2 (OS Build 26200.7922)
TC 11.57 beta2 x64 / x86
Everything 1.5.0.1406a (x64), Everything Toolbar 2.1.2, Listary Pro 6.3.6.99
QAP 12.2 x64
TC 11.57 beta2 x64 / x86
Everything 1.5.0.1406a (x64), Everything Toolbar 2.1.2, Listary Pro 6.3.6.99
QAP 12.2 x64

