How to put selected file name and path into start menu?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
iamfei
Junior Member
Junior Member
Posts: 6
Joined: 2008-11-07, 04:33 UTC
Location: China

How to put selected file name and path into start menu?

Post by *iamfei »

Hi all,

I want to add some softwares (like gawk/sed/vim) into start menu for quickly dealing with files, but how to configure start menu to transfer the selected file name and path as parameters of the item?
I check the "wincmd.ini", and find only "cm_CopyFullNamesToClip","cm_CopyNamesToClip" in the file which couldnot work.

Jason
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3897
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Select "Start - Change Start Menu"
This will open a dialog to add/modify an entry.
At the bottom of this dialog you can find the variables to use at parameter line.
#5767 Personal license
User avatar
iamfei
Junior Member
Junior Member
Posts: 6
Joined: 2008-11-07, 04:33 UTC
Location: China

Post by *iamfei »

Could anyone give me some examples about how to configure the parameter line? All of these below are from the file "TOTALCMD.CHM".

%P causes the source path to be inserted into the command line, including a backslash (\) at the end.
%N places the filename under the cursor into the command line.
%T inserts the current target path. Especially useful for packers.
%M places the current filename in the target directory into the command line.
%O places the current filename without extension into the command line.
%E places the current extension (without leading period) into the command line.
%S insert the names of all selected files into the command line. Names containing spaces will be surrounded by double quotes. Please note the maximum command line length of 32767 characters.
%S10 insert the names of the first 10 selected files (max.) into the command line. Allows to limit the number of file names passed to the program. You can use any other number.
%R like %S, but with selected names from the target panel
Notes: %N and %M insert the long name, while %n and %m insert the DOS alias name (8.3). %P and %T insert the long path name, and %p and %t the short path name. (Same for %o, %e and %s)
By putting %P, %p, %T or %t directly in front of %S or %s, the path name is inserted with the file name for each file. Example: %P%S inserts the long path and file name for all selected files.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

- First read the man pages of your used softwares (like gawk/sed/vim). and see what the await.

- second, open a DOS-Box (command line interpreter) and try the commands out

- at last, try them in TotalCommander with an user button (right click the button bar)
and exchange the real file name by TC's parameter as like %P%N, %S or %F


For an test to see what each of the TC parameter do,
you could try this with an user button
and add an question mark as very first parameter, like

Code: Select all

CMD
?PN = %P%N --- O=%O  ---- F=%F

cmd.exe
Next, execute that button, read what happens and cancel.



If you see how it works, use that for the start menu too.



- - -

Additional tip

Since you can Copy and also Paste user button,

Code: Select all

TOTALCMD#BAR#DATA
cmd
?PN = %P%N --- o=%F
cmd.exe



-1

you will find many examples in the forum, just search for "TOTALCMD#BAR#DATA"
User avatar
petermad
Power Member
Power Member
Posts: 16141
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2iamfei


For a start try with %P%N - that will most likely work as you want it.
Last edited by petermad on 2014-02-18, 19:16 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
iamfei
Junior Member
Junior Member
Posts: 6
Joined: 2008-11-07, 04:33 UTC
Location: China

Post by *iamfei »

Many thanks!
Post Reply