[-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
- Picture:
  The name of the picture in the background of the button. Double-click on the text-gadget to open a Windows-requester or enter a name, like 'PCOpus:\pic.gif'. Press <Return> when changing the filename with the keyboard.
- 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.
  If the selected file ends in 'but' and the current line in the text-gadget is not changed, the selected file is interpreted as a button and inserted into the current command at the current position. If this gadget is clicked with the right button, the current command-definition can be safed to a 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)
- *!Move accepts a destination directory (directory will be created if it does not exist already) (*!Move c:\windows)
- *!Copy accepts a destination directory (directory will be created if it does not exist already) (*!Copy c:\windows)
- *!!Archive-Add accepts an archive name to add to (*!!Archive-Add c:\temp\test.arj)
- *!SimulateDoubleClick accepts a filename (without path) (*!SimulateDoubleClick test.arj)
- *!LoadConfig accepts a config-filename (with path) (*!LoadConfig c:\PCOpus\other.cfg)
- *!ExtractReplace accepts offset and number of bytes to copy and a sourcefile (without path) (*!ExtractReplace 1000 2000 sourcefile)
- *!Compare accepts two files to compare, put *!* between the names (*!Compare file1*!*file2). Attention: If the files are identic, you will be informed, if not, nothing is displayed.
- *!PathToDrivelist accepts a name to assign to the directory (*!PathToDrivelist Name)
- *!Rename accepts a name to rename the first selected entry to (*!Rename NewName.txt) and also two patterns (*!Rename *.bmp*!**.pic)
- *!ReplacePattern accepts two patterns (replace WHAT with WHAT) (*!ReplacePattern " "*!*_)
- *!EnterCommandline accepts a direct command (*!EnterCommandline format a: /u)
- *!DeEnCode accepts a password directly (*!DeEnCode Password)
- *!Clone accepts the new name of the file directly (*!Clone NewName.ext)

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.
- Always ask {a}
  When this option is on, the {a} bracket will always ask for an answer and not use a previously given answer to the asked question.
- Delay extract
  This option may be useful if you don't want to extract the selected files from the archive you are currently in at once. With this option off, the files would be extracted two times. Test your buttons out !

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)
- {sp}
  name of parent directory of source including driveletter and complete path
- {dp}
  name of parent directory of destination including driveletter and complete path
- {sn}
  name of source directory only (for example: current dir is 'c:\test\temp', {sn} is 'temp' then)
- {dn}
  name of destination directory only
- {e}
  uses only the extension (if one exists) of the next name (test.txt to .txt)
- {c}
  adds current value of counter to the commandline, see Set for details about the counter. Use {c+} for post-increment or {c-} for post-decrement. No pre-increment, this is not a C-Compiler :-)
- {r}
  adds a value (a number) out of the registry. An example:
  {rHKEY_DYN_DATA\PerfStats\StatData|vmm\cpgswapfile} : this gives you the current size of the swapfile, please take care to place a '|' between the key and the value, if a key only has a standard value use this: {r.....key|}.
  Please note: PCOpus will add a carriage return after a value, if you add a '_' ( ....swapfile_}. Some benefits: You may define a button containing a *!message-command that displays all system-information YOU need. Or you could use a *!gotodir {RHKEY_CURRENT_USER\Software\Company\Game|InstallDir} to have a SYSTEM-INDEPENDANT command !! The powers of these brackets are unbelievable !
- {R}
  same as the {r}-bracket, only for string-entries, like pathes or similar things.
- {xf}
  first selected entry in destination window, path and filename, entry is unselected, recursive subdirs not supported !
- {xfu}
  first selected entry in destination window, path and filename, entry is not unselected, recursive subdirs not supported !
- {xo}
  first selected entry in destination window, filename only , entry is unselected, recursive subdirs not supported !
- {xou}
  first selected entry in destination window, filename only , entry is not unselected, recursive subdirs not supported !
- {Archive0}
  name of the archive we are currently in in the source-window
- {Archive1}
  name of the archive we are currently in in the destination-window
- {83}
  the next filename will be forced to be a DOS 8+3 name only. This bracket has not been tested too extremely, since I do not have too much ideas where to use it efficiently. It does what it is intended to do, though :-). The idea behind it was the following: the commandline version of the XING MPEG Encoder does not support filenames with spaces as destination name, even if they are included in "". There are two solutions: don't use spaces in names or just use this bracket this way:
  "{RHKEY_LOCAL_MACHINE\SOFTWARE\Xing Technology Corp.\XingMP3 Encoder|Path}\x3enc" "{fu}" "{83}{ne}{ou}.mp3" -b 128000
  rename "{83}{ne}{ou}.mp3" "{ne}{o}.mp3"
  Now, isn't that nice ?? Well, just take care that the destination file does not exist, not even one that could lead to a conflict with the short name.
  If you want to use this command, make sure to switch on 'CD Destination' and 'Do all files', all others off. Happy batch-wav-mp3-converting !
- {P }
  access assigned names or pathes set with the DOS set command inside buttons ({P*env_temp} insert your temp-directory.
- {_CRC}
  add CRC of file inside archive, useful for I5C cabinet archives, because here the CRC represents the index of the file.

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)
- You want to copy the directory you are currently IN to the destination:

      *!GotoDir {sp}
      *!!Select-SelectFiles {sn}
      *!Copy
      *!GotoDir {s}

- 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-]