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
How to put selected file name and path into start menu?
Moderators: Hacker, petermad, Stefan2, white
- sqa_wizard
- Power Member
- Posts: 3897
- Joined: 2003-02-06, 11:41 UTC
- Location: Germany
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.
%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.
- 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
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,
you will find many examples in the forum, just search for "TOTALCMD#BAR#DATA"
- 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
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"
2iamfei
For a start try with %P%N - that will most likely work as you want it.
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
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