Skip to content

Configure Copy Attributes Commands

This screenshot shows the Configure dialog, after selecting a Copy Attributes command in the commands list in the left pane and then pressing the View/Edit header to expand the editing controls.

Screenshot of configure dialog

In the screenshot above, the command selected is the simple Copy Filenames command that just copies the name of each selected file or folder, one per line.

The Files to Text section at the top of the screen shows how the text is generated for each file. In this example, only the name is needed as can be seen.

There are six sections in this panel.

Files to Text

This section lets you configure the text generated for each selected file.

At the top of the section is a file filter, which lets you restrict the command to files that match an extension list, wildcard pattern, or regular expression.

Add one or more parts to build up the text you want.

Folders to Text

This section lets you configure how folders are processed. This only has any effect if one or more folders are selected when the command is used.

At the top of the section is a folder filter that works in the same way as the file filter, but matches against folder names.

The first check-box in this section is Same As Files, which gives two main options for how folders are processed. If this box is checked, you get a further option Add Files From Folders that determines whether folders themselves are processed as if they were files, or whether the files inside the folders are read.

Note that recursively reading folders is not available in the free version of CopyFilenames. You need a PRO license for any commands that are configured for this.

Essentially this means that the only option that is available in the free version is when Same As Files is checked and Add Files From Folders is unchecked. You can still configure commands that use the other options in the free version, but you will be unable to copy the text generated until you have a PRO license.

There are the three options available with these two check-boxes (since Add Files From Folders is not shown if Same As Files is not checked):

Treat Folders exactly like files

For this option, you need:

Same As Files - checked
Add Files from Folders - unchecked

With these options selected, folders are treated the same as files, and the rules that are set for files in the Files To Text section are also applied to any folders.

If a property is not available for a folder (such as file size), then blank text will be generated for that value.

Expand folders and process the files they contain

license needed

For this option, you need:

Same As Files - checked
Add Files from Folders - checked

With these options selected, then for any folders selected, all the files in those folders are processed instead of the folder. This continues recursively for any sub-folders in those folders. You can limit the depth of the recursion by checking the Limit Folder Scan Depth check-box. This will limit the depth to the number selected, where a depth of 1 means just the files in the folders selected are included, a depth of 2 also includes files in the direct sub-folders of those folders, and so on.

Configure different rules for folders

license needed

For this option, you need:

Same As Files - unchecked

With this option selected, you can set different rules for folders. For each folder selected, the configuration you set in this section will be used. Most of the same part types are available as for files, but there are also two additional folder part types that allow folder recursion. These allow quite complex rules to be set up. Examples of these can be seen by looking at the Simple Folder Listing, JSON Folder Listing and XML Folder Listing commands in the default commands list.

Items Separator

This is where you can set the text that is added between the text generated for each of the selected items.

Common values are a newline, a newline and comma, or a space.

The separator, before-text, and after-text input fields show whitespace characters as visible symbols when the field is not focused:

Character Shown As
Space Middle dot (·)
Tab Right arrow (→)
Newline Return arrow (↵)

When you click into the field to edit, the actual characters are shown. These fields use a monospace font.

The difference between setting an items separator and just adding a Text part to the end of the parts for each file is that the items separator text is not added after the final item, unlike any text which is part of the text for every item.

Additional Text

This section is where you can add any additional text you want before the first item and after the last item. An example of where this might be useful is that it allows developers to include array characters surrounding the generated text. Another example is that it could be used to add a heading to the text.

Sort Options

Unless the sort option is set to As Selected, then all the items are sorted in the way selected.

Note that when leaving the sort As Selected, you may not always get the result you expect due to the way Windows File Explorer provides the list of selected items to extensions such as Copy Filenames.

Sorting by Path Length can be useful if you want to find the longest path in a folder hierarchy.

Context Menu Options

The final section in this panel does not affect the text generated.

Instead, it controls when the command appears in the context menu, using a Show Rule. The show rule determines under what conditions the command is visible, based on what is selected in Explorer.

Show Rules

Show Rule Command Appears When...
At Least One Item Any file or folder is selected (so show always)
At Least One File One or more files are selected
At Least One Folder One or more folders are selected
At Least One Link One or more links are selected
Exactly One Item Exactly one item is selected (file or folder)
Exactly One File Exactly one item is selected and it is a file
Exactly One Folder Exactly one item is selected and it is a folder
Exactly One Link Exactly one item is selected and it is a link
More Than One Item Two or more items are selected

Note: a link is a junction point or symbolic link. Links are also treated as folders.

Default Rules

Each command has a "Use Default Rules" checkbox. When checked, CopyFilenames automatically determines the appropriate show rule based on the command's part types:

  • If the command uses file-specific parts (e.g. File Size, Checksum, File Property), the default rule is At Least One File
  • If the command uses folder-specific parts (e.g. Folder Contents) or adds files from folders, the default rule is At Least One Folder
  • Otherwise, the default rule is At Least One Item, which means it will always be shown

When "Use Default Rules" is unchecked, you can select any show rule from the dropdown.