[-Contents-] [-Installation-] [-General Info-] [-Main Window-] [-Commands-] [-Menu-] [-Changes-]

# Configure Buttons

In the upper part of the window is the button bank, this is the same as in the main window. Right of this bank is the well known slider. Right of this slider are three buttons:

- Add Line: One line is added at the end of the buttonlist
- Rem Line: The last line of the buttonlist gets deleted.
- L/R: The commands for the left/right mousebutton are displayed

- Double clicking on a button allows editing of this specified button.
- You can choose a name for this button freely. It is possible to name a button 'Copy' and define the command 'Delete' for it. You should not do this for your own sake :-)
- After double clicking a button this button is marked.
- It is possible to scroll through the list of buttons using the slider The marked button will stay at its position, NOT at the selected button. It is possible to copy buttons this way.
- The command for the button can be selected from a drop down list right of the name. It is possible to have as much buttons with the same command assigned to as you want. I advise you to have your prefered commands on every bank (a bank is a 6x5 field of buttons). Therefore you do not have to look through the list of buttons each time you need to copy some files, for example.

- F
  Sets the color of the rectangle to the foreground color of the button
- B
  Set the background color
- F.C.
  Sets the foreground color of the button to the color of the rectangle
- B.C.
  Sets the background color.
- Click on the rectangle to invoke the windows color requester.
- Update
  Stores the changes made back to the marked button.
- Delete
  Clears the marked button.
- Drag to copy/Drag to move/Drag to swap/Replace:
  You can copy/move/swap buttons by dragging a button to another position.
  'Replace' is a special command here. If 'Replace' is selected, drag and drop works exactly as if 'Drag to swap' was selected. But double-clicking on a button in the button-bank copies the contents of the button currently in work to the position you double-clicked. After double-clicking with 'Replace' active, the mode is set to 'Drag to copy' again. The 'Replace' mode has been implemented to quickly copy or move buttons between the left and right button-banks.
- Font:
  You may enter a fontname of your liking or double-click on the gadget to open the standard Windows Font-Requester
- Dropdown Gadget:
  Fontsize of the selected button.
- Italic/Bold:
  Properties for the slected font
- Exit:
  Exits this configuration window

You may select a shortcut for each button. It is possible to have buttons with the same command applied to but with different shortcuts. If you need more than one shortcut, define a new button. This is useful if you used different filemanagers before. For example you may want to use 'F8' to delete files (like DCC) and the 'Delete' key, too.
Allowed shortcuts:

- Qualifiers:
  Shift, Ctrl, Alt (if you want to use Alt-Ctrl-F1 you will have to state 'Ctrl Alt F1', the order is 'Shift' then 'Ctrl' then 'Alt' and then the key !)
- Keys:
  0-9, A-Z, F1-F12, Backspace, Keypad0-Keypad9, Delete, Pos1, End, Up, Down, Left, Right (for cursor keys).

For example if you want to use Ctrl-Alt-Backspace for a command you have to enter 'Ctrl Alt Backspace' or 'CTRLALTBACKSPACE'. Spaces are ignored. No case-sensitivity here.
If 'KP' is checked, shortcuts can be assigned by pressing the keys wanted.

### External Commands

If you select 'External command' you get to the external command definition.

Defining 'External Commands' gives a quite powerful instrument to the user. External commands are batchfiles that are created with the commands the user provides here and the files that are selected before the command is called.
Before we get to an exact explanation of the powers of the batchfiles a quick description of the buttons and gadgets.

- In the big list window command of the external command are displayed.
- Up moves the selected line up
- Down moves it down
- Delete deletes the selected line.
- Insert inserts a line at the current position the last line is removed if too much lines are defined.
- A maximium of 11 lines are available.
- Below the list window is a text gadget where the line can be edited.
- {...}
  brings up a drop-down list of all available brackets (the brackets are quite powerful, explanation and examples later on)
- *!...
  opens the drop down list with all available internal commands
  Selecting an entry of the drop down list or clicking on '{...}' or '*!...' again closes the drop down lists again.
- ...
  opens a requester to search for a command/file

Using internal commands within an external command requester was introduced with version 1.70c. You may use any combination of internal and external commands in the list.
Well, it might be a bit confusing to define internal commands in an external command button, but you will get used to it.
Useful is, for example:

    *!batchselect filename
    *!copy

or (perhaps :-))

    *!gotodir c:\windows
    *!dirbottom

or

    subst {aEnter Driveletter}: /D
    subst {aEnter Driveletter}: {s}
    *!RefreshDriveDir

to copy a single file from a specific directory to another specific directory you can define:

    *!GotoDir dir2    (destination dir)
    *!ChangeSide
    *!GotoDir dir1    (source dir)
    *!!Select-SelectFiles filename   (file to copy)
    *!Copy

Please remember that it is only possible to stop running this kind of batch-process by pressing 'Shift-ESC' or using the *!Message command.

Specials about internal commands:

- *!GotoDir accepts a pathname or the name assigned to a directory in Standard adjustments/Paths (*!GotoDir C:\Windows, *!GotoDir temp, *!GotoDir [SYSDRIVE])
- *!BatchSelect accepts a filename (*!BatchSelect c:\opus\files1.txt)
- *!!Select-SelectFiles accepts a pattern (*!!Select-SelectFiles *.exe *.txt)
- *!Filter accepts a mask (*!Filter *.exe *.dll)
- *!Message accepts (indeed) a message (*!Message If you continue, your harddrive will implode !)
- *!HuntPattern accepts a pattern (*!HuntPattern *.exe)
- *!MakeDir accepts a directoryname to create in the current directory (*!MakeDir foobar)
- *!WinStandard accepts a programname to execute directly (*!WinStandard c:\utils\winzip\winzip)
- *!Requester accepts a filename (*!Requester example.req)
- *!ASCIIFileFilter accepts a filter (*!ASCIIFileFilter text1 !text2)
- *!SaveOutputList accepts a filename (*!SaveOutputList output.txt)

It is possible to use any bracket with internal commands, but they will not always have effects (see list above)
The commands defined are run exactly as defined, please make sure to have the correct order.

The checkbuttons:

- Use DOS 8+3 names
  only the DOS 8+3 names are used for the command
- CD Destination
  makes a CD to the inactive window before the command is executed. If this is not checked, a CD to the active window is performed.
- Recursive Dirs
  All files in all selected directories and sub-directories are used for the batch-command.
- Pause at end
  After the command is completed you will have to press a key to close the window.
- Wait
  PCOpus waits until the command has finished.
- Do all files
  The commands in the batch-file are repeated until all selected files are handled.
- ReRead Source
  Rereads the source directory after the command is completed.
- ReRead Destination
  dito, with destination directory.
- Quote filename
  all filenames are enclosed in quotation marks "".
- Invisible Window
  The output window that is opened when calling an external command will only be visible in the Windows Taskbar.
  If you are using Pause at end you will have to click on this icon, activate the window and press a key.
  If the command is called from inside an archive, this option is ignored.
- VB Calls
  Unfortunately, Bill has some strange ideas :-) The ASCII code for Windows and DOS is DIFFERENT !! Therefor, paths containing german (perhaps other languages have the same problem) special chars (like ö,ü,ä etc.) are different when used under DOS. This results in the inability of PCOpus to call programs with pathes that contain chars like this (In my opinion, you should NEVER use spaces or special chars in any name on any computer. This may have unpredicatble results !)
  If you experienced problems when defining buttons and PCOpus did not start the programs correctly (as said above: System problem, no PCOpus bug !), use this checkbox.
  Example for german users: if you defined a button with wordpad this way: c:\programme\zubehör\wordpad.exe {f} it did not work, now define your button this way: *!WinStandard c:\programme\zubehör\wordpad.exe {f} and activate 'VB Calls'. This should do the trick !
- Clear 'Hidden' at once
  PCOpus starts batchfiles when calling external programs. A set hidden bit tells PCOpus that this batchprocess is still running. If batchfiles are called from within these batchfiles it is possible (always ?) that the called batches inside PCOpus batches will not return properly to the former batch process. Check this option if you want to 'end' the batch process at once. The batchfiles created by PCOpus will be deleted properly then. Of course, the batchfile will be executed. Please use this option only if Batchfiles are called.

Available brackets:

- {f}
  first selected entry, drive, path and filename, entry is unselected
- {fu}
  first selected entry, drive, path and filename, entry is not unselected
- {F}
  all selected entries, drive, path and filename, entries are unselected
- {o}
  first selected entry, name only, entry is unselected
- {ou}
  first selected entry, name only, entry is not unselected
- {O}
  all selected entries, name only, entries are unselected
- {aXXX*!YYY}
  Ask user for text XXX and insert text here. Default answer is 'YYY'. '*!YYY' may be left out.
- {d}
  name of destination directory, including driveletter and complete path
- {dl}
  driveletter of destination drive
- {s}
  name of source directory, including driveletter and complete path
- {sl}
  driveletter of source drive
- {tmp}
  drive and path of temp directory
- {ne}
  removes the extension (if one exists) from then next name (test.txt to test)

To learn about these things, experiment with them. It is quite easy and very powerful:

- To open a selected file with Notepad you could define a button 'Notepad', select 'External command' and enter in a line:
  C:\WINDOWS\notepad.exe {f}
  If 'CD Destination' is unchecked, you could use {o} instead.
  Also you could use {fu} or {ou} if you dont want the file to be unselected afterwards.
- To copy a single file from Source to Destination you could use:
  copy {fu} {d}\{o}
  with 'CD Destination' checked.
  This works only for files, not for directories. It is just an example, not very useful. Please note the usage of {fu} here.
- This were some quite simple examples, now to something more complex: Imagine you have a ZIP file and you want to extract it quickly to a subdirectory with the same name as the ZIP file in the same directory as the ZIP file:

      rename {ou} temp.xxx
      md {ne}{ou}
      copy temp.xxx {ne}{ou}
      del temp.xxx
      cd {ne}{ou}
      ren temp.xxx {ou}
      pkunzip -d -o {ou}
      del {o}
      cd ..

  (CD Destination must be unchecked)
- One more example: You want to compare two files in a single directory and view the differences afterwards. The name of the file containing the differences should be entered by the user.

      fc /B {f} {f} >{tmp}\{aEnter filename*!Answer.txt}
      c:\windows\notepad.exe {tmp}\{aEnter filename*!Answer.txt}
      wait 10
      del {tmp}\{aEnter filename}

  The 'wait' and 'del' command can be useful, but be aware of the deletion of the file. It could happen that the file gets deleted before notepad was able to open the file.
  The {axxx} request is not asked again if 'xxx' is the same text inside the brackets. Sounds complicated, an explanation:
  You have two files selected in the active directory, file1 and file2. You click on your defined 'File compare' button (or whatever you called it). The program creates the following batchfile (your path is path and your temp directory is c:\windows\temp, and you entered 'test' during the first request) :

      fc /B path/file1 path/file2 >c:\windows\temp\test
      c:\windows\notepad.exe c:\windows\temp\test
      wait 10
      del c:\windows\temp\test

If you need information about what the program creates by clicking an external command, go to your temp directory and look at a PCOxxxxx.bat file.
If an external command does not return for some reason, click on 'Force return' in your taskbar and then on 'Reactivate PCOpus'.

[-Contents-] [-Installation-] [-General Info-] [-Main Window-] [-Commands-] [-Menu-] [-Changes-]