Select Page

Custom Toolbar buttons

There is nothing like a piece of well-designed software that you can make you work for you. Every once in a while you come across a particular situation that sounds like: “I need to create a folder with the same name as all these files” or where is the Control Panel or even open all these files with their associated editors. Here’s a way to do it.

First open the Button Bar… editor.

Total Commander Configuration Menu

Configuration Menu

Then click add to create a new button.

Total Commander Change button bar

Change button bar dialog

Click on Help if you want to find out about the most obvious things.

Or get stuck in and create your first button. Click Command Lookup to open the “Choose command” dialog. Select Navigation and then cm_OpenControls and click OK.

Selecting the Command

Selecting the Command

Back in the “Change button bar” dialog click OK again. That’s your first button created. A  is now available to select the Windows control panel.

Next is the open all files button. Open the “Change button bar” again and add a new button. Fill in the following:

  • Command: cmd /c c:\bin\MultiFileOpenEXT.cmd
  • Parameters: %S
  • Start path: leave empty
  • Icon file: wcmicons.dll
  • Icon: select number 28
  • Tooltip: Multi Open
  • Tick “Run minimized”

Click ok and the create the file MultiFileOpenEXT.cmd. In the example it’s created in the c:\bin folder but you can omit the path part and store the file in a folder that’s in the PATH Environment variable.

This is the contents of MultiFileOpenEXT.cmd:

@ECHO OFF
SETLOCAL
CLS
::   REM Cursor is on [..]
IF "%~1"=="" GOTO:EOF

:_LOOP
SET isDir="%~a1"
SET isDir=%isDir:~1,1%

::   NOT A Directory, Open File
IF NOT "%isDir%"=="d" (
   START "" "%~1"
)
IF NOT "%~2"=="" (
   SHIFT
   GOTO:_LOOP
)

This tip comes from the following source:

http://ghisler.ch/board/viewtopic.php?t=25972&highlight=command+line+parameters

For a more thorough explanation of cmd files:

http://ss64.com/nt/cmd.html and  http://ss64.com/nt/syntax-args.html

To create a button that creates folders with the same name as the selected files follow the same procedure but with these changes:

  • Command: cmd /c c:\bin\MultiMakeDirectoryEXT.cmd
  • Icon: 29
  • Tooltip: Multi MD

This is the contents of MultiMakeDirectoryEXT.cmd:

@ECHO OFF
SETLOCAL
CLS
::   REM Cursor is on [..]
IF "%~1"=="" GOTO:EOF

:_LOOP
SET isDir="%~a1"
SET isDir=%isDir:~1,1%

::   NOT A Directory, Open File
IF NOT "%isDir%"=="d" (
MD "%~n1"
)
IF NOT "%~2"=="" (
SHIFT
GOTO:_LOOP
)

Note the line MD “%~n1 now has n1 to indicate just the name.

Just get customising and work a lot faster.

If you like this article please let other people know by using the share options below.