Opening a file with Lister from a batch file or shortcut
Moderators: Hacker, petermad, Stefan2, white
Opening a file with Lister from a batch file or shortcut
I have some Text and Word files that I frequently use for reference. Is there a way to view them using TC's built-in lister without having to launch them directly from TC?
I want to create a batch file or an icon on the desktop that once triggered, will open an RTF or TXT file using Lister because I like how fast it is.
Thanks.
I want to create a batch file or an icon on the desktop that once triggered, will open an RTF or TXT file using Lister because I like how fast it is.
Thanks.
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
HelpFile,
Command line parameters:
Command line parameters:
Example BatchFile:/S=L Start Lister directly, pass file name to it for viewing (requires full name including path).
Accepts additional parameters separated by a colon, e.g. /S=L:AT1C1250
A ANSI/Windows text
S ASCII/DOS text
V Variable width text
T1..T7 View mode 1-7 (1: Text, 2: Binary, 3: Hex, 4: Multimedia, 5: HTML, 6:Unicode, 7: UTF-8)
C<nr> Codepage, e.g. C1251 for Cyrillic
N Auto-detect, but no multimedia or plugins allowed
P<x> As LAST parameter: Choose plugin, e.g. /S=L:Piclview for iclview plugin (As shown in Lister title)
Code: Select all
@Echo OFF
START "" "C:\Program Files\TotalCMD\TotalCMD.exe" /S=L "C:\The\Path\to\SomeFile.txt"
If you want you can also drag and drop file to a batch shortcut (one file at the time )
Code: Select all
@START "" "C:\Program Files\TotalCMD\TotalCMD.exe" /S=L %1
- Matthias030
- Senior Member
- Posts: 423
- Joined: 2007-03-04, 10:48 UTC
- Location: Berlin
Can I use commander path as a parameter. I am trying to use this as a hard coded button in button bar.
This my example, but commander path doesn't work:
This my example, but commander path doesn't work:
Code: Select all
/S=L "%COMMANDER_PATH%\tmp\example.txt"
I just realized that I can put parameter in command field, like this:
Code: Select all
%COMMANDER_PATH%\totalcmd.exe /S=L "%COMMANDER_PATH%\tmp\example.txt"
%COMMANDER_PATH% is undefined if no TC is already running !amilino wrote:I just realized that I can put parameter in command field, like this:Code: Select all
%COMMANDER_PATH%\totalcmd.exe /S=L "%COMMANDER_PATH%\tmp\example.txt"
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
Horst.Epp,
He starts Lister from TC buttonbar.
amilino,
TC only expands environment variables in command field (as you've realized), but %-parameters like %P%N (focused file) may only be used in parameters field.
You can also pass environment variables to a program as is if program supports them. E.g. in this case you can pass /S=L "%%COMMANDER_PATH%%\tmp\example.txt" in parameters (just double percents in order to pass them as is), and new TC instance will expand variables and open file in Lister.
BTW in TC 8+ you can use %COMMANDER_EXE% instead of %COMMANDER_PATH%\totalcmd.exe.
He starts Lister from TC buttonbar.

amilino,
TC only expands environment variables in command field (as you've realized), but %-parameters like %P%N (focused file) may only be used in parameters field.
You can also pass environment variables to a program as is if program supports them. E.g. in this case you can pass /S=L "%%COMMANDER_PATH%%\tmp\example.txt" in parameters (just double percents in order to pass them as is), and new TC instance will expand variables and open file in Lister.
BTW in TC 8+ you can use %COMMANDER_EXE% instead of %COMMANDER_PATH%\totalcmd.exe.
This thread startet with the following:MVV wrote:Horst.Epp,
He starts Lister from TC buttonbar.
...
I have some Text and Word files that I frequently use for reference. Is there a way to view them using TC's built-in lister without having to launch them directly from TC?
I want to create a batch file or an icon on the desktop that once triggered, will open an RTF or TXT file using Lister because I like how fast it is.
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
Which a mod should split into its own thread "Can I use commander path as a parameter".MVV wrote:Yes, but it was 6 years ago... while amilino has asked his question only 2 hours ago.
As Horst.Epp indirectly points out, the new question, committing thread necromancy, isn't even related to the original.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
Re: Opening a file with Lister from a batch file or shortcut
NB: you must add the /i=path_to_my_settings.ini switch or Lister will open with the default settings (wrong locale and no plugins).