Opening a file with Lister from a batch file or shortcut

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
risk
Junior Member
Junior Member
Posts: 85
Joined: 2007-07-30, 03:18 UTC

Opening a file with Lister from a batch file or shortcut

Post by *risk »

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.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

HelpFile,
Command line parameters:
/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)
Example BatchFile:

Code: Select all

@Echo OFF
START "" "C:\Program Files\TotalCMD\TotalCMD.exe" /S=L "C:\The\Path\to\SomeFile.txt"
User avatar
nsp
Power Member
Power Member
Posts: 1803
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

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
User avatar
Matthias030
Senior Member
Senior Member
Posts: 414
Joined: 2007-03-04, 10:48 UTC
Location: Berlin

Post by *Matthias030 »

Also there exists Lister as standalone exe.

http://www.ghisler.com/lister/
milkaca
Junior Member
Junior Member
Posts: 53
Joined: 2015-02-23, 23:47 UTC
Location: Germany

Post by *milkaca »

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:

Code: Select all

/S=L "%COMMANDER_PATH%\tmp\example.txt"
milkaca
Junior Member
Junior Member
Posts: 53
Joined: 2015-02-23, 23:47 UTC
Location: Germany

Post by *milkaca »

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"
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6449
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

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"
%COMMANDER_PATH% is undefined if no TC is already running !
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6449
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

MVV wrote:Horst.Epp,
He starts Lister from TC buttonbar. :)
...
This thread startet with the following:

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 x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Yes, but it was 6 years ago... while amilino has asked his question only 2 hours ago. :)
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

MVV wrote:Yes, but it was 6 years ago... while amilino has asked his question only 2 hours ago. :)
Which a mod should split into its own thread "Can I use commander path as a parameter".

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.
vkl
Junior Member
Junior Member
Posts: 4
Joined: 2020-05-05, 15:12 UTC

Re: Opening a file with Lister from a batch file or shortcut

Post by *vkl »

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).
Post Reply