# Codes for passing filenames

The following codes are used to pass the names of selected files to external programs. The filename codes available offer all possible combinations of the following five criteria:

* **Full paths** or **filename only** - whether the full path and name of selected items are passed (e.g. _C:\Program Files\GPSoftware\Directory Opus\dopus.exe_) or just the filename (e.g. _dopus.exe_).
* **One at a time** or **all at once** - when multiple files are selected, this determines whether a command is repeated once for each selected file, or run once only, with all selected filenames passed on the same command line (separated by spaces).
* **Selected items required** or **not required** - when selected items are required and none are selected, the command will not be run at all. When selected items are not required, the command will still be run and it will act as if the filename code was not present at all.
* **Long filenames** or **short filenames** - short filenames are useful for running 16 bit programs or other legacy software that can't handle long filenames.
* **Source** or **destination file display** - in a dual-display Lister, you can pass selected files from the destination file display as well as from the source.

The long form of each code is built from a combination of keywords that reflect the five criteria. If a long code ends in a **$** sign it is the "selected items required" form of the code - it is said to "need" selected items.

| Long form               | Short form | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| {filepath}              | {f!}       | <p>Passes the full path and filename of each selected item. Files are passed one at a time - a command that uses this code will be repeated once for each additional selected item. If no files are selected the command will still be run, passing an empty string for this code.<br><em>Full paths, one at a time, selected items not required, long filenames, source file display</em></p>                                                                                                |
| {filepath$}             | {f}        | <p>The "need" form of <strong>{filepath}</strong> (requires at least one selected item in the file list).<br><em>Full paths, one at a time, selected items required, long filenames, source file display</em></p>                                                                                                                                                                                                                                                                             |
| {file}                  | {o!}       | <p>Passes the filename only of each selected item (without its path). Multiple files are passed one at a time.<br>Filenames only, one at a time, selected items not required, long filenames, source file display</p>                                                                                                                                                                                                                                                                         |
| {file$}                 | {o}        | <p>The "need" form of <strong>{file}</strong>.<br><em>Filenames only, one at a time, selected items required, long filenames, source file display</em></p>                                                                                                                                                                                                                                                                                                                                    |
| {allfilepath}           | {F!}       | <p>Passes the full path and filename of all selected items at once. The command will only be run once, no matter how many items are selected - the names of all selected items will be passed on the command line separated by spaces. You can use the <strong>sep=</strong> modifier (described below) to specify an alternative separator character.<br><em>Full paths, all at once, selected items not required, long filenames, source file display</em></p>                              |
| {allfilepath$}          | {F}        | <p>The "need" form of <strong>{allfilepath}</strong>.<br><em>Full paths, all at once, selected items required, long filenames, source file display</em></p>                                                                                                                                                                                                                                                                                                                                   |
| {allfile}               | {O!}       | <p>Passes the filename only of all selected items at once. File paths are not passed.<br>Filenames only, all at once, selected items not required, long filenames, source file display</p>                                                                                                                                                                                                                                                                                                    |
| {allfile$}              | {O}        | <p>The "need" form of <strong>{allfile}</strong>.<br>Filenames only, all at once, selected items required, long filenames, source file display</p>                                                                                                                                                                                                                                                                                                                                            |
| {filepathshort}         | {fs!}      | <p>Passes the full path and filename of each selected item, in short (8.3) format. This is useful for running 16 bit programs or other legacy software that can't handle long filenames.<br><em>Full paths, one at a time, selected items not required, short filenames, source file display</em></p>                                                                                                                                                                                         |
| {filepathshort$}        | {fs}       | <p>The "need" form of <strong>{filepathshort}</strong>.<br><em>Full paths, one at a time, selected items required, short filenames, source file display</em></p>                                                                                                                                                                                                                                                                                                                              |
| {fileshort}             | {os!}      | <p>Passes the filename only (no paths) of each selected item, in short (8.3) format.<br>Filenames only, one at a time, selected items not required, short filenames, source file display</p>                                                                                                                                                                                                                                                                                                  |
| {fileshort$}            | {os}       | <p>The "need" form of <strong>{fileshort}</strong>.<br>Filenames only, one at a time, selected items required, short filenames, source file display</p>                                                                                                                                                                                                                                                                                                                                       |
| {allfilepathshort}      | {Fs!}      | <p>Passes the short (8.3) form of the full path and filename of all selected items at once.<br><em>Full paths, all at once, selected items not required, short filenames, source file display</em></p>                                                                                                                                                                                                                                                                                        |
| {allfilepathshort$}     | {Fs}       | <p>The "need" form of <strong>{allfilepathshort}</strong>.<br><em>Full paths, all at once, selected items required, short filenames, source file display</em></p>                                                                                                                                                                                                                                                                                                                             |
| {allfileshort}          | {Os!}      | <p>Passes the filename only of all selected items at once, in short (8.3) format.<br>Filenames only, all at once, selected items not required, short filenames, source file display</p>                                                                                                                                                                                                                                                                                                       |
| {allfileshort$}         | {Os}       | <p>The "need" form of <strong>{allfileshort}</strong>.<br>Filenames only, all at once, selected items required, short filenames, source file display</p>                                                                                                                                                                                                                                                                                                                                      |
| {filepathdest}          | {fd!}      | <p>Passes the full path and filename of each selected item in the destination file display. Files are passed one at a time - a command that uses this code will be repeated once for each additional selected item. If no files are selected in the destination, or there is currently no destination, the command will still be run, passing an empty string for this code.<br><em>Full paths, one at a time, selected items not required, long filenames, destination file display</em></p> |
| {filepathdest$}         | {fd}       | <p>The "need" form of <strong>{filepathdest}</strong>. If there are no files selected in the destination, or there is currently no destination, the command will not be executed.<br><em>Full paths, one at a time, selected items required, long filenames, destination file display</em></p>                                                                                                                                                                                                |
| {filedest}              | {od!}      | <p>Passes the filename only of each selected item from the destination file display (without its path). Multiple files are passed one at a time.<br>Filenames only, one at a time, selected items not required, long filenames, destination file display</p>                                                                                                                                                                                                                                  |
| {filedest$}             | {od}       | <p>The "need" form of <strong>{filedest}</strong>.<br>Filenames only, one at a time, selected items required, long filenames, destination file display</p>                                                                                                                                                                                                                                                                                                                                    |
| {allfilepathdest}       | {Fd!}      | <p>Passes the full path and filename of all selected items, from the destination file display, all at once. The command will only be run once, no matter how many items are selected - the names of all selected items will be passed on the command line separated by spaces.<br><em>Full paths, all at once, selected items not required, long filenames, destination file display</em></p>                                                                                                 |
| {allfilepathdest$}      | {Fd}       | <p>The "need" form of <strong>{allfilepathdest}</strong>.<br><em>Full paths, all at once, selected items required, long filenames, destination file display</em></p>                                                                                                                                                                                                                                                                                                                          |
| {allfiledest}           | {Od!}      | <p>Passes the filename only of all selected items at once, from the destination file display. File paths are not passed.<br>Filenames only, all at once, selected items not required, long filenames, destination file display</p>                                                                                                                                                                                                                                                            |
| {allfiledest$}          | {Od}       | <p>The "need" form of <strong>{allfiledest}</strong>.<br>Filenames only, all at once, selected items required, long filenames, destination file display</p>                                                                                                                                                                                                                                                                                                                                   |
| {filepathshortdest}     | {fsd!}     | <p>Passes the full path and filename of each selected item, in short (8.3) format, from the destination file display. This is useful for running 16 bit programs or other legacy software that can't handle long filenames.<br><em>Full paths, one at a time, selected items not required, short filenames, destination file display</em></p>                                                                                                                                                 |
| {filepathshortdest$}    | {fsd}      | <p>The "need" form of <strong>{filepathshortdest}</strong>.<br><em>Full paths, one at a time, selected items required, short filenames, destination file display</em></p>                                                                                                                                                                                                                                                                                                                     |
| {fileshortdest}         | {osd!}     | <p>Passes the filename only (no paths) of each selected item in the destination file display, in short (8.3) format.<br>Filenames only, one at a time, selected items not required, short filenames, destination file display</p>                                                                                                                                                                                                                                                             |
| {fileshortdest$}        | {osd}      | <p>The "need" form of <strong>{fileshortdest}</strong>.<br>Filenames only, one at a time, selected items required, short filenames, destination file display</p>                                                                                                                                                                                                                                                                                                                              |
| {allfilepathshortdest}  | {Fsd!}     | <p>Passes the short (8.3) form of the full path and filename of all selected items at once, from the destination file display.<br><em>Full paths, all at once, selected items not required, short filenames, destination file display</em></p>                                                                                                                                                                                                                                                |
| {allfilepathshortdest$} | {Fsd}      | <p>The "need" form of <strong>{allfilepathshortdest}</strong>.<br><em>Full paths, all at once, selected items required, short filenames, destination file display</em></p>                                                                                                                                                                                                                                                                                                                    |
| {allfileshortdest}      | {Osd!}     | <p>Passes the filename only of all selected items at once, in short (8.3) format, from the destination file display.<br>Filenames only, all at once, selected items not required, short filenames, destination file display</p>                                                                                                                                                                                                                                                               |
| {allfileshortdest$}     | {Osd}      | <p>The "need" form of <strong>{allfileshortdest}</strong>.<br>Filenames only, all at once, selected items required, short filenames, destination file display</p>                                                                                                                                                                                                                                                                                                                             |

The filename codes all support the following modifiers. These can be added to the control code sequence using a vertical bar (**|**) to separate the filename code from the modifier - for example, **{file|noext}** strips the file extension from the returned filename. Multiple modifiers can be provided using additional vertical bars to separate them - for example **{file|noext|escwild}** combines both **noext** and **escwild** together.

| Modifier                                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **noext**                                                         | Strips the filename extension from filenames. For example, if **{file}** returned _cat\_photo.jpg_ then **{file\|noext}** would return _cat\_photo_. Note that if the item is a folder then its name will not be changed, even if it contains a dot, as folders are not considered to have file extensions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **ext**                                                           | Returns only the filename extension (the opposite of **noext**). For example, if **{file}** returned _cat\_photo.jpg_ then **{file\|ext}** would return _.jpg_. Note that if the item is a folder then nothing is returned, even the folder's name contains a dot.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **ext2**                                                          | Returns the filename extension without the dot. For example, if **{file\|ext}** returned _.jpg_ then **{file\|ext2}** would return _jpg_.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **ext=**_\<ext>_                                                  | Replaces the original filename extension with the specified one. For example, **{file\|ext=tmp}** would return the name of each selected file with the extension changed to _.tmp_. Folder names are not changed, even if they contain dots.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **escbackslash**                                                  | <p>Automatically escapes any occurrences of <strong>\</strong> in the filename, turning them into <strong>\</strong>.<br>This can be necessary when using codes like <strong>{filepath}</strong> to insert paths into strings which will have sequences like \n and \ interpreted specially.<br>For example, a command to add the selected file from the source and the selected file from the destination to the clipboard on separate lines:</p><p><a href="../internal_commands/clipboard"><strong>Clipboard</strong></a> <strong>EXPANDNEWLINES SET {filepath|escbackslash}\n{filepathdest|escbackslash}</strong>.</p><p>In this example, if the source file was <em>C:\New Folder\test.txt</em> then it would be converted to <em>C:\New Folder\text.txt</em>. If the  sequence had not been escaped, it would have removed the letter <em>N</em> from the path and put <em>ew Folder\text.txt</em> on a separate line. (There are more subtle cases when dealing with folder paths, but they are less important with file paths.)</p> |
| **escforfilter**                                                  | <p>Intended for inserting paths into inline filter definitions.<br>The same as <strong>escbackslash</strong> and <strong>escwild</strong> combined, but easier to remember and less to type.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **escnl**                                                         | <p>Automatically escapes any occurrences of  in the filename, turning them into .<br>(This is a weaker version of <strong>escbackslash</strong>, above. You should probably use <strong>escbackslash</strong> instead.)<br>Using <strong>escnl</strong> helps when using codes like <strong>{filepath}</strong> as the message text for a dialog code like <a href="codes_to_display_dialogs"><strong>{dlgstring}</strong></a>. For example, the path <em>C:\New Folder\test.txt</em> would be converted to <em>C:\New Folder\test.txt</em>. If the  sequence wasn't escaped, it would have been converted into a line-break in the dialog message text.</p>                                                                                                                                                                                                                                                                                                                                                                                |
| <p><strong>escregex</strong><br><strong>escregexp</strong></p>    | <p>Automatically escapes any regular expression characters in the filename. Used when passing filenames to internal commands that understand <a href="../../wildcard_reference/regular_expression_syntax">regular expressions</a>, in case a filename contains characters like <strong>\</strong>, <strong>.</strong>, <strong>(</strong> and <strong>)</strong> which have special meaning to some functions. For example, <strong>{file|escregexp|noext}</strong> would turn <em>Accounts (2010).xls</em> into <em>Accounts \2010\</em>.<br>For convenience, both the "regex" and "regexp" spellings are allowed and do the same thing.</p>                                                                                                                                                                                                                                                                                                                                                                                               |
| **escwild**                                                       | Automatically escapes any wildcard characters in the filename. Used when passing filenames to internal commands that understand [standard wildcards](../../wildcard_reference/pattern_matching_syntax), in case a filename contains characters like **(** and **)** which have special meaning to some functions. For example, **{file\|escwild\|noext}** would turn _Accounts (2010).xls_ into _Accounts '(2010')_.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **file**                                                          | Redirects the filenames to a temporary text file. This is useful with external programs that can accept a list of files from a text file rather than on the command line. (In turn, that is useful because command lines have a maximum length which may limit the number of filenames you can pass directly.) The name of the temporary file is passed on the command line in place of the filenames themselves. In the text file, each filename is separated by a space. If a filename or its path contains an embedded space it will be surrounded by quotes. For example, **{allfilepath\|file}**.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **filem**                                                         | The same as **file** except that each filename is written to a separate line in the text file. For example, **{allfilepath\|filem}**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **fileq**                                                         | The same as **file** except that each filename is always surrounded by quotes, whether it contains an embedded space or not. For example, **{allfilepath\|fileq}**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **filemq**                                                        | The same as **filem** except that each filename is always surrounded by quotes. For example, **{allfilepath\|filemq}**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **utf8**                                                          | Forces the file written by **file**, **filem** or **fileq** to use UTF-8 format. For example, **{allfilepath\|filem\|utf8}**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **ucsle**                                                         | Forces the file written by **file**, **filem** or **fileq** to use UCS-16LE format. For example, **{allfilepath\|filem\|ucsle}**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **ucsbe**                                                         | Forces the file written by **file**, **filem** or **fileq** to use UCS-16BE format. For example, **{allfilepath\|filem\|ucsbe}**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **urlencode**                                                     | URL-encodes the filename it adds to the command line. Useful if you want to pass the filename to the Internet in some way. For example, you could have a context menu command which does an automatic Google search for the selected filename with: [**https://www.google.com/search?q={file\|urlencode**](https://www.google.com/search?q=%7Bfile%7Curlencode)**}**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **nobom**                                                         | Prevents a BOM from being written that identifies the file type. For example, **{allfilepath\|filem\|utf8\|nobom}**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **cronly**                                                        | When used with **filem** or **filemq**, makes it so the file has only CR (carriage return) characters between each line. The default is CR,LF pairs as is standard on Windows. For example, **{allfilepath\|filem\|cronly}**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **lfonly**                                                        | When used with **filem** or **filemq**, makes it so the file has only LF (line feed) characters between each line. The default is CR,LF pairs as is standard on Windows. For example, **{allfilepath\|filem\|lfonly}**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **nopath**                                                        | Returns only the final component of the path. For example, if **{filepath}** returns _C:\Program Files\GPSoftware\Directory Opus\\_, **{filepath\|nopath}** would return _Directory Opus\\_. You would normally use something like **{file}** to get just the name of something, but using **{filepath\|nopath}** has the subtle difference of including the \ on the end of the name when the item is a folder.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **noroot**                                                        | Removes the root (i.e. the first component) from the file's path. For example, if **{filepath}** returns _C:\Windows\Notepad.exe_, **{filepath\|noroot}** would return _Windows\Notepad.exe_. With UNC network paths, the result is relative to the share, with the computer and share itself removed. With FTP paths, the result is relative to the site's root and excludes the site itself. You can combine **noroot** with **..** to get a parent path with the root removed. For example, **{filepath\|..\|noroot}**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **noshort**                                                       | Suppresses automatic shortening of file paths which are longer than 260 characters. Opus itself can handle very long paths but many Windows programs cannot. When sending very long paths to external programs, Opus normally uses the short (8.3) versions to reduce problems. Use **noshort** to prevent this when you know the target program can cope. For example, **{filepath\|noshort}**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **noterm**                                                        | Removes the trailing path separator from folder paths. For example, **{filepath}** might return _C:\Program Files\\_ whereas **{filepath\|noterm}** would return _C:\Program Files_.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **notermdrive**                                                   | Similar to **noterm**, but also removes the trailing path separator when the resultant path is a drive root with no sub-directory. For example, both **{sourcepath}** and **{sourcepath\|noterm}** might return _C:\\_ whereas _C:_ would be returned by **{sourcepath\|notermdrive}**. Drive roots are a special case in Windows and generally require a trailing backslash, but there are exceptions (like the Windows **subst** command) where the backslash must be omitted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **subdir**                                                        | Replaces characters in the file's path so that the full path can be added below another path. For example, **{filepath\|subdir}** might return _C;\Windows\Notepad.exe_. Note that a semi-colon has replaced the colon, allowing the path to be used relative to another directory, say if you wanted to create a backup of the file called _D:\Backups\C;\Windows\Notepad.exe_.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **regex**                                                         | <p>Allows testing and manipulation of the filename.</p><table><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>{file|regex=</strong><em><strong>&#x3C;pattern></strong></em><strong>)</strong></td><td>only process the file if the pattern matches; otherwise it will be skipped</td></tr><tr><td><strong>{file|regex=</strong><em><strong>&#x3C;pattern></strong></em><strong>|to=</strong><em><strong>&#x3C;new name></strong></em><strong>)</strong></td><td>output the result of the regular expression search and replace (only if the pattern matches)</td></tr><tr><td><strong>{file|regex!=</strong><em><strong>&#x3C;pattern></strong></em><strong>|to=</strong><em><strong>&#x3C;new name></strong></em><strong>)</strong></td><td>as above, but if the pattern doesn't match it outputs the original filename unchanged</td></tr></tbody></table><p>If your regular expression contains a | symbol, you should enclose the whole pattern in quotes.</p>                                                         |
|                                                                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **{file\|regex=**_**\<pattern>**_**)**                            | only process the file if the pattern matches; otherwise it will be skipped                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **{file\|regex=**_**\<pattern>**_**\|to=**_**\<new name>**_**)**  | output the result of the regular expression search and replace (only if the pattern matches)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **{file\|regex!=**_**\<pattern>**_**\|to=**_**\<new name>**_**)** | as above, but if the pattern doesn't match it outputs the original filename unchanged                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **cleanfilename**                                                 | Replaces any illegal filename characters in the string, and also replaces all path separators and colons, so the string can be used as a filename without it adding any additional path levels. Similar to **subdir** in this context, but it also replaces path separators.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **cleanfilepath**                                                 | Replaces any illegal filename characters in the string, while leaving path separators and colons. (Colons are only left in if they are part of a drive letter at the start of the string.) Should be used when the string can be an absolute path. (Will not usually have an effect in this context, given the input should already a valid file name or path. More useful with clipboard data.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **cleanfilepathrel**                                              | Replaces any illegal filename characters in the string, also replacing colons and "\\" UNC path initiators, so the string can be used as a subdirectory under another path. Similar to **subdir** in this context, given the input is already a file name or path. (Unlike **subdir**, **cleanfilepathrel** can also be used with arbitrary clipboard input.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **wsl**                                                           | Returns the path in WSL (Windows System for Linux) format (e.g. **/mnt/c/Program Files/** instead of **C:\Program Files**).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **sep=**                                                          | Lets you specify an alternative separator for codes that insert multiple filenames on the one line. For example, **{allfilepath}** normally inserts all selected filepaths separated by spaces. You could use **{allfilepath\|sep=,}** to have the filepaths comma-separated instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **..**                                                            | Modifies the code to refer to the selected item's parent folder rather than the item itself. You can pass multiple .. modifiers separated by **\\** to return folders higher up the tree. For example **{filepath\|..\\.}** would return the name of the item's parent's parent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **\\**                                                            | Modifies the code to refer to the root of the drive of the selected item. For example **{filepath\|\\** might return **C:\\**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **driveletter**                                                   | <p>Modifies the code to refer to the drive letter, on its own, at the start of the selected item's path. For example <strong>{filepath|driveletter}</strong> might return <em>C</em>. If the path is not relative to a drive letter, the whole path will be inserted as-is.<br>You can also use <strong>{filepath|\</strong> to get something like <em>C:\</em>, or <strong>{filepath|\notermdrive}</strong> to get something like <em>C:</em>, while handling non-drive roots (e.g. UNC paths) differently.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **drivelabel**                                                    | Modifies the code to refer to the label for the drive letter at the start of the selected item's path. For example **{filepath\|drivelabel}** might return _System_. If the path is not relative to a drive letter, the whole path will be inserted as-is.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

In addition to the above codes, the following control codes are supported to provide compatibility with Windows Explorer. They can not be used in MS-DOS batch functions.

| Modifier | Equivalent To                                              |
| -------- | ---------------------------------------------------------- |
| **%1**   | {filepath}                                                 |
| **%2**   | {filepath}                                                 |
| **%L**   | {filepath}                                                 |
| **%V**   | {filepath} if anything is selected; {sourcepath} otherwise |
| **%**\*  | {allfilepath}                                              |
