This is a answers-only, no-questions how-to thread. Don't post questions, post here how-tos' only.
--------------------------------------------------------------
Buttonbar
How to create an button
Right click on the button bar at the top and select "Change..."
In the "Change button bar" dialog, click "Add", then fill in the properties as follows:
Code: Select all
Command = <your application with full or relative path, or a TC EM_ or CM_ command>
Parameters = <parameters for your application, e.g. TCs parameter (press F1 key for help)>
Start path = <if need, or leave empty>
Icon file = <e.g.: %commander_path%\WCMICONS.DLL>
Tooltip = <a hint for you, so you still know next week what this button do.| Use a pipe symbol to insert a line break>
Enable "[_]Run minimized" or Run maximized, if wanted
Then click OK to create the button.
Note: you do not need to take care on and fill out all fields. "Command" is mandatory, "Icon" too, else the button is not visible. "Parameters" only if need.
Visible Command options:
Command: '-1' insert an separator between two buttons (an free space, and with option '[x]Flat Icons' a pipe-like symbol '|')
Command: '-2' insert a line break in button bar to get two rows.
ghisler(Author) wrote:the button bar auto-wraps when it becomes too wide
ghisler(Author) wrote:Total Commander 7.5 will support both a user-defined line break in the bar (command: -2)
and an unlimited number of lines!
https://www.ghisler.ch/board/viewtopic.php?p=144991#144991
While button is open for modification, press F1-key for more help.
....
...
%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.
%P%S insert the names of all selected files into the command line, with full path. Names containing spaces will be surrounded by double quotes.
Do NOT put quotes around %P%S yourself!
...
%L, %l, %F, %f, %D, %d, %WL, %WF, %UL, %UF create a list file in the TEMP directory
with the names of the selected files and directories,
and appends the name of the list file to the command line.
...
%L Long file names including the complete path, e.g. c:\Program Files\Long name.exe
%F Long file names without path, e.g. Long name.exe
...
%UL, %UF like %L and %F, but with a UTF-8 Unicode list file (with byte order marker)
%WL, %WF like %L and %F, but with a UTF-16 Unicode list file (with byte order marker)
...
....
Note: you can use environment variables (like "%WinDir%" or "%Commander_Path%") in the Command field only.
You cannot use environment variables in "parameters" because they collide with placeholders like %P%N.
You could use environment variables in Parameter field too, but only, if you would use "COMSPEC" as commando,
like: %COMSPEC% /c start "" "%COMMANDER_PATH%\ADDONS\TCMENU.EXE"
-or-
like: cmd /c start "" "%COMMANDER_PATH%\ADDONS\TCMENU.EXE"
(Note the empty quote pair after start, that are for an emtpy title. See START /? help for more)
But than you have to double percent signs in Parameters field too: "%%APPDATA%%\GHISLER\windows.bar"
Example:
Code: Select all
Command=%ComSpec%
Parameters=/c ""X:\Path\To\xsltproc.exe" --output "%P%O (out).%E" --novalid %%COMMANDER_DRIVE%%\XSLT\my_transform.xsl "%P%O.%E""
TCs paramter like %N %N %T etc. can normaly be use in Parameter field only.
But you can put parameters in "command" input box if you use double quotes correctly, e.g.
"%COMMANDER_Path%\Program name" "%COMMANDER_DRIVE% and other stuff" other_parameter
Also try double percent signs:
Command=cmd /c
Parameters=Start "" "%%Commander_Path%%\Tools\Notepad2.exe" %P%N
(Please note that TC will quote %P%N himself, so don't quote them by yourself)
Often you would just call a DOS batch or a VBS script and send the TCs paramter as arguments:
Command: cmd /k %COMMANDER_DRIVE%\XML\xslt\style-transform.cmd
%COMMANDER_DRIVE%
Parameter:
"%P%N"
style-transform.cmd batch (%COMMANDER_DRIVE%\XML\xslt\style-transform.cmd)
Code: Select all
@echo off
set uri=%2
set uri=%2:\=/%
set xslt=%1\XML\xslt\style-transform.xslt
set xslt=%xslt:\=/%
%1\java\jre\bin\java.exe -cp %1\SaxonHE9\saxon9he.jar net.sf.saxon.Transform -xsl:%xslt% -u jar:file:///%uri%!/word/document.xml -o:%~n2.xml
%1 ==>
%COMMANDER_DRIVE%
%2 ==>
%P%N (the selected file incl. path)
Deutsch: %L und andere Platzhalter werden nur im Feld "Parameter" ersetzt.
Dafür werden im Feld "Befehl" Umgebungsvariablen unterstützt.
Beides geht leider nicht, das könnte zu nicht eindeutigen Situationen führen,
etwa %P%N -> Ersetzen von %P% durch Umgebungsvariable P statt %P durch Pfad.
ghisler(Author)
Note: you can also drag&drop a application.exe on the buttonbar to create a new button.
Next right click the new button and chose "Modify" to set it up correctly.
- - -
User who read this explanation also read the following posts below:
-- How to find and use TCs' internal command
-- TCs' user commands (em_xxxxx)
-- Add shortcut key to em_ or cm_ commands
- - -
How to create an button by drag&drop
You also can create an Button by drag & dropping an executable (exe/vbs/ahk/etc....) onto the button bar.
Next right click on that button and choose "Change...".
Read more in the section above ^^^^^^
- - -
TOTALCMD#BAR#DATA
You can also create new buttons by copy and paste an existend button
or by pasting an button code, provided in the forum, like:
Code: Select all
TOTALCMD#BAR#DATA
cmd /c
for /f "tokens=*" %%D in ('type %F') do @md "%%~nD"
C:\Windows\system32\cmd.exe
Create Folder from Files
-1
Copy that code, right click on the button bar, chose "Paste", done.
Explanation:
Line 1: let TC detect his own code in clipboard
Line 2: the commando
Line 3: the parameters (leading ‘?’ will show you the command before actual executing
Line 4: path to icon file
Line 5: tooltip
Line 6: default start path
Line 7: app window parameter: minimized /maximized (usercmd.ini: iconic)
Line 8: number of the TC internal command, if any in line 2. Else ‘-1’ for other commands.
---
viewtopic.php?p=335674#335674
Erklärung zu TOTALCMD#BAR#DATA
Dies ist der Code für einen Total Commander-Button/Knopf
zwecks Austausch zwischen Anwendern über das Forum:
Code: Select all
TOTALCMD#BAR#DATA
cmd /k
?ECHO %P%N %T%M
C:\Windows\system32\cmd.exe
Hier eine |kurze Erklärung|als Tooltip
-1
Erklärung:
Zeile 1: dadurch kann der TC diesen Code in der Zwischenablage erkennen und den 'Einfügen'-Eintrag im Button-Kontextmenü einblenden.
Zeile 2: Der Befehl / das Kommando
Zeile 3: Die Parameter zum Befehl (das führende '?' bewirkt, dass das Kommando beim Ausführen erstmal angezeigt wird)
Zeile 4: Pfad zur Datei des Icons
Zeile 5: Der Tooltip
Zeile 6: Der Startpfad
Zeile 7: Aufrufparameter minimized Als Symbol /maximized maximiert (usercmd.ini: iconic)
Zeile 8: Die Nummer des internen TC-Befehls falls Zeile 2 einen solchen beinhaltet, ansonsten '-1' bei anderen Befehlen.
Anwenden dieses Codes:
- den Code markieren > in die Zwischenablage kopieren > rechts Klick auf die Buttonbar am gewünschten Platz > "Einfügen" auswählen.
Weitere Hilfe:
Drücke im geöffneten Button-Dialog (rechts Klick auf die Buttonbar > Ändern...) die F1-Taste um die Hilfe zu den Parameter zu lesen.
Klicke dort auf das Lupen-Symbol Icon um eine Liste der TC-internen Befehle zu sehen.
- - -
Some information from the wiki:
The Button bar
With the button bar you can call menu commands, external programs and even other button bars.
If you leave the mouse cursor on a button for a moment, a small window with a description will appear( if you haven't deactivated it in Help texts).
You can easily add buttons to the button bar using Drag&Drop (with pressed SHIFT key).
By pressing the right mouse button, you can open a local menu, which allows to change or delete buttons.
For further changes in the button bar you should use the Dialog box to change the whole button bar.
Read more at >>>
http://www.ghisler.ch/wiki/index.php/Buttonbar
Mit der Buttonbar lassen sich Menübefehle, externe Programme sowie weitere Buttonbars aufrufen.
Lässt man den Mauscursor einen Moment auf einem Button stehen, so erscheint eine Erklärung (sofern dies nicht unter Optionen deaktiviert wurde).
Die Buttonbar lässt sich durch einfaches Drag&Drop (bei gedrückter Umsch-Taste) einfach erweitern.
Mit der rechten Maustaste öffnen Sie ein lokales Menü, mit dessen Hilfe Sie einfach Buttons ändern bzw. löschen oder auch kopieren können.
Für weitergehende Änderungen am Buttonbar empfiehlt sich die Verwendung der Dialogbox zum Ändern der ganzen Buttonbar.
Mehr Infos >>>
http://www.ghisler.ch/wikide/index.php/Buttonbar
--------------------------------------------------------------
Buttonbar wechseln ToDo bzw. wip
Buttonbar wechseln
Haupt-Buttonbar ändern
Umschalten zwischen Buttonbars
http://www.ghisler.ch/wikide/index.php/Buttonbar_wechseln
- - -
Mehrere Buttonbars anlegen und zwischen denen umschalten:
TC speichert die Buttonbar-Einstellungen in einer Textdatei mit Endung 'BAR'
Standardmäßig heißst die ("Haupt-buttonbar") Datei 'DEFAULT.BAR', man kann diese aber nennen wie man möchte.
Welche Datei genommen wird steht in der wincmd.ini (falls abweichend vom Standard)
unter '[Buttonbar]' und 'Buttonbar='
(INFO: die '*.br2'-Dateien sind cache der Icons)
Bei mir steht dort:
Buttonbar=%commander_path%\plugins\BARs\Menu01.BAR
Meine 'Menu01.BAR' ist im einfachsten Fall eine Kopie der 'DEFAULT.BAR'
Aber der erste Button dieser 'Menu01.BAR' verweist auf die selbe 'Menu01.BAR'
Der zweite Button verweist auf eine 'Menu02.bar'
Der Dritte auf '%Commander_Path%\plugins\BARs\Menu03.bar', u.s.w.
Die anderen Bars' haben die selben ersten Buttons.
Dadurch kann man von jeder Bar auf eine andere Bar umschalten.
(Extra Tipp: die jeweilige Bar verweist für ihren eigenen Button auf ein etwas
andersfarbige Icon, welches den Eindruck eines gedrückten Zustands vermittelt)
In der *.bar-Datei sieht das in etwa so aus:
[Buttonbar]
Buttoncount=72
button1=%Commander_Path%\plugins\BARs\Menu01-Gedrueckt.ico
cmd1=%Commander_Path%\plugins\BARs\Menu01.bar
iconic1=0
menu1=Menu01 - Main
button2=%Commander_Path%\plugins\BARs\Menu02.ico
cmd2=%Commander_Path%\plugins\BARs\Menu02.bar
iconic2=0
menu2=Menu02 - Special tools
button3=%Commander_Path%\plugins\BARs\Menu03.ico
cmd3=%Commander_Path%\plugins\BARs\Menu03.bar
iconic3=0
menu3=Menu03 - Work
button4=%Commander_Path%\plugins\BARs\Menu04.ico
cmd4=%Commander_Path%\plugins\BARs\Menu04.bar
Die *.bar-Dateien sind reine Textdateien und können "von Hand" editiert werden.
Für einen Weg über das Menü siehe das Wiki:
http://www.ghisler.ch/wikide/index.php/Buttonbar_wechseln
Das Tool '
Nested Button Bar Creator 2.00' erleichter die Erstellung und spendiert die nötigen Buttons.
http://utceditors.totalcmd.net/tc_tools/nested_button_bar_creator/overview.htm
http://utceditors.totalcmd.net/tc_tools/nested_button_bar_creator/overview_de.htm
http://ghisler.ch/board/viewtopic.php?t=8829
http://totalcmd.net/plugring/bar_creator.html
--------------------------------------------------------------
Button as Drop-Down Menu
http://ghisler.ch/board/viewtopic.php?p=215709#215709
ts4242 Power Member Posted: Tue Jan 18, 2011 7:54
1- Right click on empty part in button bar and choose "Change..."
2- On Change button bar dialog press Add button.
3- Press Change >> button and select Add subbar from the menu
4- In open dialog type new file name
5- TC will open another Change button bar dialog, add your favorite programs.
6- Before closing this dialog check the option "Show as menu"
http://ghisler.ch/board/viewtopic.php?p=216387#216387
petermad Power Member Posted: Sun Jan 30, 2011 15:13
To make for example a subbar for your graphics programs do the following:
1. Open your main button bar in the "Change button bar" dialog by right clicking on the empty area
at the end of the button bar, or using the menu: "Configuration" -> "Button Bar...".
2. Add a new button by cliking the "Add" button.
3. Press the button marked "Change >>" and choose "Add Subbar >>".
4. Write for example graphics.bar as the File name in the Browse dialog and click OK.
- You are not bound to create a dummy *.bar file prior !
- Just state a new (non-existing yet) name in the upper field of the Add sub-bar dialogue, and TC'll create the file !
5. Now a second "Change button bar" dialog window is opened with a new bar file called graphics.bar.
6. Add your graphic programs one by one to that new bar and click OK when you are finished.
7. Now you are back to the dialog with you main button bar, and in the right side of the dialog
there will now be an option "Show as menu" that you can select. That option is ONLY visible
when the Command field has a *.bar file in it. Select it and click OK
If you click the new button, the subbar with the graphics will open as a menu. If you Shift+click the new button
it will replace the main button bar - use the first button to get back to your main button bar again.
Balderstrom Power Member Posted: Sun Jan 30, 2011 20:16
As far as what petermad was talking about,
Here's an example of a very simple button bar:
Command: %TCData%\GUI\ToolBars\PackUnpack.bar
IconFile: %TCData%\GUI\Icons\mwmMix0510.icl
NOTE: Make sure you tick: [v] Show as a menu
Contents of "PackUnpack.bar"
[Buttonbar]
Buttoncount=3
button1=%TCDATA%\GUI\Icons\mwmMix0510.icl,56
cmd1=cm_PackFiles
iconic1=1
menu1=(+) Pack ++
button2=
iconic2=0
button3=%TC%\wcmIcons.dll,31
cmd3=cm_UnpackFiles
iconic3=1
menu3=Unpack
When you click on that button - that is on your main button bar a drop down menu will be shown. There is also a wincmd.ini setting:
If you shift click on that icon, it will replace your main-button bar with the contents of that "sub" button-bar.
You can as well add as the first (or last) item a "switch" button that activates your main button bar.
that button will NOT be shown when the button-bar is displayed as a list/drop down menu.
What all this _doesn't_ do, is it is not layed out like a Grid (opera-speeddial like). It is just a drop-down menu with icons.
MVV Power Member Posted: Wed Jan 19, 2011 10:19
Yes, you can't drag items directly to subbar, but if you click menu button while Shift is down,
TC will open this subbar as usual buttonbar - so you will be able to drag items to it.
Then you may click first buttonbar button Go back (TC always creates this button for new bars) to return to main buttonbar.
- - -
Third party tools
MGP Software >>>
http://www.mgpsoft.net/Downloads/
TCmenu19.zip >>>
http://www.mgpsoft.net/Downloads/TCmenu.jpg
TCToolbar14.zip >>
http://www.mgpsoft.net/Downloads/TCToolbar.jpg
http://ghisler.ch/board/viewtopic.php?t=738
http://ghisler.ch/board/viewtopic.php?p=52917#52917[quote]TCMenu shows buttonbar file as pulldown menu.
TCToolbar shows buttonbar file as secondary temporarily toolbar.[/quote]
--------------------------------------------------------------
Icon Resources to use as Button icon
On default, put "%Commander_Path%\WCMICONS.DLL"
in the Icon file box, press TAB-key and choose an Icon.
But there are many more Icon libraries on your computer.
For an reference go to:
https://diymediahome.org/windows-icons-reference-list-with-details-locations-images/
They have a nice, full list of available Icons:
%windir%\system32\compstui.dll (Common Property Sheet User Interface)
%windir%\system32\ddores.dll (Device Category Information and Resources)
%windir%\system32\ieframe.dll (Internet Explorer)
%windir%\system32\imageres.dll (Windows Image Resource)
%windir%\system32\mmcndmgr.dll (Microsoft Management Console Node Manager)
%windir%\system32\MORICONS.DLL (Windows NT Setup Icon Resources)
%windir%\system32\netshell.dll (Network Connections Shell)
%windir%\system32\pnidui.dll (Network System Icons)
%windir%\system32\shell32.dll (Windows Shell Common)
%windir%\system32\wmploc.dll (Windows Media Player Resources)
%windir%\system32\pifmgr.dll (Windows NT PIF Manager Icon Resource Library)
%windir%\system32\wpdshext.dll (Portable Devices Shell Extension)
%windir%\system32\comres.dll (COM -Ressourcen)
%windir%\system32\dmdskres.dll (Disk Management Support Snap-In)
%windir%\system32\Dsuiext.dll (Directory Service Common UI)
%windir%\system32\inetcplc.dll (Internet Control Panel)
%windir%\system32\mstscax.dll (Remote Desktop Services ActiveX Client)
%windir%\system32\setupapi.dll (Windows Setup API)
%windir%\system32\shdocvw.dll (Shell Doc Object and Control Library)
%windir%\system32\urlmon.dll (OLE32\Extension for Win32)
%windir%\system32\wiashext.dll (Imaging Devices Shell Folder UI)
%windir%\system32\mmres.dll (General Audio Resources)
Put the path to such DLL into the Icon file box,
press TAB-key and choose an Icon.
--------------------------------------------------------------
Some of many thousend related forum posts (search the forum for more)
Sync-Aufgabe als Button anlegen, geht das?
Kommando: %COMMANDER_EXE%
Parameter: /S=S:= D:\ I:\
Startpfad: %COMMANDER_PATH%
Icondatei: TOTALCMD.EXE
viewtopic.php?t=43435
Oft gebrauchte Verzeichnisse als Button anlegen?
Mappe verbinde Ordner als Laufwerk buchstaben SUBST NET USE
viewtopic.php?t=48075
Textdatei mit Button anlegen u. automatisch öffnen m. Editor
Kommando: cmd
Parameter: /c chcp 1252 & cmd /c echo %P>"_my file.txt"&& START "" "%%COMMANDER_PATH%%\Tools\Notepad2.exe" /l 2 "_my file.txt"
Startpfad: leer (blank)
Icondatei: %COMMANDER_PATH%\Tools\Notepad2.exe
Tooltip: Textdatei (_my file.txt) im aktuellen Ordner erzeugen MIT Pfad in Textzeile Nr. 1
viewtopic.php?t=47391
Suchen per Button sofort starten
Suche so einstellen wie gewünscht und abspeichern in der Registerkarte "Laden/Speichern", beispielsweise als "Hans_Willi".
Dann im TC einen neuen Button anlegen mit dem Kommando "LOADSEARCH Hans_Willi".
-oder-: totalcmd.exe /O /S=F:Hans Willi.
viewtopic.php?p=290037#290037
Button anlegen: Sprung zu Links=C: Rechts=D:
c:\totalcmd\TOTALCMD64.EXE /O /L=c:\ /R="d:\
-oder-: OPENTABS myTabfile.tab
viewtopic.php?t=40785
Dateiliste filtern
Kommando: CD >MeineFilter
viewtopic.php?p=332759#332759
Button für "Hinzufügen zur Media Player Classic Playlist"
Kommando: C:\Pfad\zu\MPC-HC.exe
Parameter: /open /add "%P%O.%E"
viewtopic.php?t=39514
Button zum Automatischen erstellen von Ordnern?
Kommando: cmd.exe
Parameter: /k chcp 1252 & for /f "usebackq delims=" %%i in (%P%N) do @echo "%%i"
viewtopic.php?t=34248
Help in parameters of button bar
Command: %COMMANDER_PATH%\Tools\MyBatch.cmd
Parameters: "%F" "%P" "%T"
viewtopic.php?p=285726#285726
User command to pass two file names to external executable
P%S %T%R
%P%S2
viewtopic.php?p=325378#325378
"New text file" (possibly unicode enc.) on button
CMD = cmd /c
PARAM = ?COPY "%Commander_PATH%\ShellNew\unicode.txt" "_newfile.txt"
viewtopic.php?p=323723#323723
Script for many selected files
Command: "path2script\PowerISOCreate.vbs"
Parameters: "%T" "%L"
viewtopic.php?p=321729#321729
How to create multiple folders at once? 1..50
CMD: PowerShell -NoProfile -NoExit
viewtopic.php?p=321343#321343
--------------------------------------------------------------
Links to other posts:
A basic button bar menu demo
viewtopic.php?t=22857
--------------------------------------------------------------
Finde mich:
Find me: