List To Clipboard

Content

  1. Introduction
  2. Features
  3. Installation
  4. Add a start menu entry or a button
  5. Set parameters for the user defined command
  6. Overview of all possible parameters
  7. Examples
  8. Versions hints
  9. Author contact

1. Introduction

This program is an improvement to the internal commands

Using this tool you are to able to define exactly how paths are copied.

2. Features:

see also: section parameters and examples for detailed explanations.

3. Installation:

Extract the content of the archive to a directory of your choice; for example: %PROGRAMFILES%\Total Commander\Addons\Lst2Clip\

4. Add a start menu entry or a button

start menu entry:

  1. In menu "start" select "Change start menu".
  2. Click button "Add Item".
  3. Enter title.
  4. Continue to section "Set parameters for the user defined command".

Hotkeys

You may also want to define a hotkey, if you require to use the command frequently. The start menu entry has to be one of the first ten entries, otherwise you'll have to extend the file "Totalcmd.inc". You have to remember the entries position. The following example uses a start menu entry on position 5.

  1. In menu "Configuration" select "Options".
  2. Select tab sheet "Misc".
  3. Select a hotkey.
  4. Select cm_usermenu5 in the command dropdown. The identifier can be changed in "Totalcmd.inc".
  5. Push the little button to the right to apply hotkey.

The file "Totalcmd.inc" is located in the Total Commander directory.

Buttonbar Button:

  1. In menu "Configuration" select "Button bar" (or right-click on unused spaced in your button bar).
  2. Push button "append".
  3. Continue to section "Set parameters for the user defined command".

Alternatively you may drag & drop the file "Lst2Clip.exe" into the button bar.

5. Set parameters for the user defined command

You have to enter valid values to the fields "Command" and "Parameters". You don't have to care about the other fields. Simpelst possible example: It's absolutely similar to cm_CopyFullNamesToClip. You have to enter the following values to the fields:

Command: %PROGRAMFILES%\Total Commander\Addons\Lst2Clip\Lst2Clip.exe
Parameters: /L:"%L"

You have to adapt the path to your own. In general the field "Command" includes program path and optional parameters.
The field "Parameters" includes the list file. This parameter is mandatory.

6. Overview of all possible parameters

UNC-path

/U converts paths of mapped drives into UNC network paths. This parameters is only required, if the network path is assigned to a local drive. If you access the network path directly, the parameter is not required. /U should be the first parameter.

No extension

/NE (no extension) Use this parameters to suppress copying of file extensions.

path depth

/PD (path depth) The path depth defines how many parts of a path will be copied. You can specify how many path parts will be copied at the beginning and at the end. The root is included in the count. Between these two parts ...\ is placed. Click here for a detailed example.

Prefix

/P Prefix, which will inserted before each line. Example: /P:"PRE"

Suffix

/S Suffix, which will be inserted after each line.. Example: /S:"POST"

Replacing string parts

/R is a parameter, which can be used multiple times. You may use it to replace parts of each line. In the following example all occurrences of "Righteous" will be replaced by "Lefteous" and all Occurrences of "12345" will be eliminated: Example: /R:"Righteous"="Lefteous" /R:"12345"="" Attention: Quotation marks should always be set as shown in the above example. String replacement is case sensitive.

File list

/L The file list. /L must be the last parameter. The following values are possible:

(taken from Total Commander help system)

%p and%t can be used too.

recommanded parameter order

Lst2Clip.exe [/U] [/NE] [/PD] [/RB] [/P] [/S] [/R] /L

Parameters in brackets can be omitted. Another order could lead to unwanted side effects.

7. Examples

A path should look like the paths in java.net.URI; example:

C:\My Projects\3D_App\src\gui\MainFrame.java

The path will be copied as:

file:/C:/My%20%Projects/3D_App/src/gui/MainFrame.java

Command: Lst2Clip.exe /P:"file:/" /R:"\"="/" /R:" "="%20%"
Parameters: /L:"%L"

Another Example: You need to copy a long path in a readable way. Given the following path:

C:\Directory 1\Directory 2\Directory 3\Directory 4\Directory 5\Directory 6\Directory 7\File.txt

Command: Lst2Clip.exe /PD:"3"="3"
Parameters: /L:"%L"

The result is: C:\Directory 1\Directory 2\...\Directory 6\Directory 7\File.txt

More examples:

For java.net.URL enter the following values:
Command: Lst2Clip.exe /P:"file:/" /R:"\"="/"
Parameters: /L:"%L"
 
For "windows-paths" with UNC-Prefix the following settings are required:
Command: Lst2Clip.exe /P:"\\?\" /R:"\"="\\"
Parameters: /L:"%L"
 
To copy the current source path of a mapped drive:
Command: Lst2Clip.exe /U
Parameters: /L:"%P"
 
Copy the current source path without finally backslash:
Command: Lst2Clip.exe /PD:"0"="1" /RB
Parameters: /L:"%P"
 
Copy file names without path and without file extension:
Command: Lst2Clip.exe /NE
Parameters: /L:"%F"
   
Copy short paths (dos-style) to clipboard
Command: Lst2Clip.exe
Parameters: /L:"%l"

8. Versions hints

2003/11/07 Version 1.02  
    Copying the file extension can now be omitted.
    You may now limit the path depth.
    The backslash at the end of the path can be omitted.
2003/11/05 Version 1.01  
    bugfix: The parameters %P and %T should now work properly.
    new feature: The parameters /U converts paths of mapped drives into UNC network paths.
2003/10/13 Version 1.0  
    first release

9. Author contact

Visit the Total Commander Forum. Copyright (C) 2003 Lefteous, All rights reserved. This Total Commander addon is copyrighted freeware.