Copy

The Copy internal command can be used to:

  • Copy and move files and folders

  • Create and add files to archives

  • Extract files from archives

  • Perform simple one-way file synchronization

  • Create links, shortcuts and junctions

  • Install fonts

  • Send files via email

  • Add items to file collections, and include folders in libraries

Command Arguments:

Argument
Type
Possible values
Description

ADDTOARCHIVE

/O

(no value)

Example: Copy ADDTOARCHIVE

The CREATEFOLDER argument can be used to change the default archive name.

Example: Copy ADDTOARCHIVE CREATEFOLDER="Backup"

<archive format>

Example: Copy ADDTOARCHIVE=.rar

The archive format can be optionally followed by parameters that are specific to the selected format. Currently the only format that defines optional parameters is Zip, those are listed below.

Example: Copy ADDTOARCHIVE=.zip,fullpaths

You can also use this command to create a self-extracting archive from the selected files, with the following arguments:

Example: Copy ADDTOARCHIVE=.zip+sfx

fullpaths

When creating Zip archives, this turns on the Save full file paths option by default.

Example: Copy ADDTOARCHIVE=.zip,fullpaths

nofullpaths

When creating Zip archives, this disables the Save full file paths option.

Example: Copy ADDTOARCHIVE=.zip,nofullpaths

keepfolder

Modifies the behaviour when only a single folder is selected - instead of the items within the folder being added, the folder itself will be added to the archive.

Example: Copy ADDTOARCHIVE=.zip,keepfolder

nokeepfolder

Adds the contents of the folder when only a single folder is selected.

Example: Copy ADDTOARCHIVE=.zip,nokeepfolder

comp:<compression>

Specifies the compression level when creating Zip archives. You can use one of the keywords store, fastest, fast, normal, good and best, or provide a number from 0 to 19. Numbers 10 and above enable enhanced compression; otherwise the enhanced or noenhanced keywords can also be used to override the default.

Example: Copy ADDTOARCHIVE=.zip,comp:best,enhanced

split:<size>

When creating Zip archives, this sets the default value for the Split archive option.

Example: Copy ADDTOARCHIVE=.zip,fullpaths,split:2.5MB

nosplit

When creating Zip archives, this disables the Split archive option.

Example: Copy ADDTOARCHIVE=.zip,nosplit,nofullpaths

ARCHIVE

/O

(no value)

Adds all selected files and folders to a Zip file named after the first selected item. Note that if only a single folder is selected, the items within that folder are added rather than the folder itself - this prevents you from ending up with a Zip file containing an unnecessary sub-folder.

Example: Copy ARCHIVE

The CREATEFOLDER argument can be used to change the default archive name.

Example: Copy ARCHIVE CREATEFOLDER="Backup"

<archive format>

Adds all selected files and folders to an archive of the specified format. The archive format can be optionally followed by parameters that are specific to the selected format - see ADDTOARCHIVE above for a list of these.

Example: Copy ARCHIVE=.rar

single

Each selected item will be added to its own archive, rather than all items being added to the one archive.

Example: Copy ARCHIVE=single

keepfolder

Modifies the behaviour when only a single folder is selected - instead of the items within the folder being added, the folder itself will be added to the archive.

Example: Copy ARCHIVE=keepfolder

nokeepfolder

Adds the contents of the folder when only a single folder is selected.

Example: Copy ARCHIVE=nokeepfolder

AS

/O

(no value)

When copying or moving files, you will be prompted to enter a new name for each file.

Example: Copy MOVE AS

<new name>

Example: Copy AS *.bak HERE

AUTOSELECT

/K

yes

Example: Copy DUPLICATE AUTOSELECT=yes

no

Newly copied files will not be selected, no matter what the Automatically select newly copied files option is set to.

Example: Copy AUTOSELECT=no

BUFSIZE

/K/N

<size in bytes>

This buffer is in addition to any buffering provided by the filesystem, hardware, and so on; it is not connected to the non-buffered IO mode controlled by the NONBUFIO argument and copy_nonbufferio_threshold Preferences option.

Example: Copy BUFSIZE 128KB

This has no effect when doing simple file-to-file copies and delegating to the very-high-level Windows file-copy API, since that API performs its own buffering. See the DELEGATE argument for more detail.

BURNCD

/S

(no value)

Invokes the system CD Burning Wizard, which initiates burning of any files you have previously copied to the CD staging area.

Example: Copy BURNCD

CLEARREADONLY

/K

yes

Example: Copy CLEARREADONLY=yes

no

Do not clear the read-only flag when copying files.

Example: Copy CLEARREADONLY=no

COLLLIST

/S

(no value)

Example: Copy COLLLIST

COPYATTR

/K

yes

Preserves file attributes when copying files or folders.

Example: Copy COPYATTR=yes

no

Do not preserve file attributes (the newly copied file will have the default file attributes for a newly created file).

Example: Copy COPYATTR=no

COPYDESC

/K

yes

Preserves file descriptions when copying files or folders, when the descriptions are not stored within NTFS ADS or when NTFS ADS is not otherwise being copied.

Example: Copy COPYDESC=yes

no

Do not preserve file descriptions beyond what may be done if NTFS ADS are being copied.

Example: Copy COPYDESC=no

COPYDIRTIMES

/K

all

Preserves the Modified and Created timestamps of copied folders.

Example: Copy COPYDIRTIMES=all

In all cases, the Accessed timestamp is handled the same as the Modified timestamp. Accessed timestamps are not mentioned explicitly because they are a legacy feature of Windows that are not usually worth thinking about.

none

Prevents preservation of the Modified and Created timestamps of copied folders; instead, the timestamps will be reset to the date and time the copy is made.

Example: Copy COPYDIRTIMES=none

onlymodified

Preserves the Modified timestamps while preventing preservation of the Created timestamps of copied folders.

Example: Copy COPYDIRTIMES=onlymodified

onlycreated

Preserves the Created timestamps while preventing preservation of the Modified timestamps of copied folders.

Example: Copy COPYDIRTIMES=onlycreated

COPYFILETIMES

/K

all

Preserves the Modified and Created timestamps of copied files.

Example: Copy COPYFILETIMES=all

In all cases, the Accessed timestamp is handled the same as the Modified timestamp. Accessed timestamps are not mentioned explicitly because they are a legacy feature of Windows that are not usually worth thinking about.

none

Prevents preservation of the Modified and Created timestamps of copied files; instead, the timestamps will be reset to the date and time the copy is made.

Example: Copy COPYFILETIMES=none

onlymodified

Preserves the Modified timestamps while preventing preservation of the Created timestamps of copied files.

Example: Copy COPYFILETIMES=onlymodified

onlycreated

Preserves the Created timestamps while preventing preservation of the Modified timestamps of copied files.

Example: Copy COPYFILETIMES=onlycreated

COPYOWNER

/K

local

Copy file owner information, when the copy takes place between local drives only.

Note that setting the file owner requires elevation and may produce a UAC prompt.

Example: Copy COPYOWNER=local

all

Copy file owner information for all drives, not just local ones.

Example: Copy COPYOWNER=all

no

Do not copy file owner information.

Example: Copy COPYOWNER=no

COPYPROPERTIES

/K

yes

Always copy NTFS ADS properties/metadata when copying files and folders.

Example: Copy COPYPROPERTIES=yes

no

Always remove NTFS ADS metadata when copying files.

Example: Copy COPYPROPERTIES=no

fastest

Copy NTFS ADS metadata when copying files, unless it is slower to do so.

Example: Copy COPYPROPERTIES=fastest

COPYSECURITY

/K

yes

Copy security permissions when copying files between NTFS drives.

Example: Copy COPYSECURITY=yes

no

Do not copy security permissions. Newly copied files will inherit the default security permissions of the destination folders.

Example: Copy COPYSECURITY=no

COPYSPARSE

/K

yes

Recreate sparse regions in the copied file (when the source file is sparse).

Example: Copy COPYSPARSE=yes

no

Do not recreate sparse regions in the copied file. Newly copied files will occupy their full size on disk.

Example: Copy COPYSPARSE=no

COPYTOCOLL

/K

member

Example: Copy COPYTOCOLL=member

sub

Copy folders to collections as sub-collections (the contents of the folder will be added as member items to the newly created sub-collection).

Example: Copy COPYTOCOLL=sub

ask

Ask how to copy folders to collections.

Example: Copy COPYTOCOLL=ask

CREATEFOLDER

/O

(no value)

Prompts for the name of a new folder and copies the selected files and folders into that folder.

Example: Copy CREATEFOLDER

<folder name>

Example: Copy CREATEFOLDER "Backup-{date|yyyyMMdd}"

When archiving files, this specifies the name of the archive to create or update. (If you don't specify an archive name it will default to the name of the first selected file, without its extension, or the name of the current folder if no file selection is used.). The example below adds the selected files to an archive called "Cat Photos.zip" below the current folder:

Example: Copy HERE ARCHIVE=.zip CREATEFOLDER="Cat Photos"

DELEGATE

/K

yes

no

Overrides the copy_allow_delegation setting the opposite way: Custom file-copying code will always be used, even when it is not required. (Not recommended outside of very special cases.)

Example: Copy DELEGATE=no

DUPLICATE

/S

(no value)

Example: Copy DUPLICATE

EXTRACT

/O

(no value)

Extracts the contents of selected archives to the destination folder. You can also use this with folders to copy their contents without copying the folder itself.

Example: Copy EXTRACT

sub

Creates a sub-folder in the destination named after the archive, and extracts the archive contents to that folder.

Example: Copy EXTRACT=sub

checkout

Extracts the contents of an archive to a temporary folder and automatically opens that folder in a new Lister. You can use this to "check out" the files in an archive before you decide if and where you want to extract them to. Note that this command only works when you are inside the archive itself (e.g. double-click a .zip file to enter it, and then run the "checkout" command to extract it).

Example: Copy EXTRACT=checkout

FILE

/M

<filename> ...

Specifies the name of the file or files to copy. If you don't provide this argument the command operates on all selected items in the source Lister. This is the default argument for the Copy command - you don't need to specify the FILE keyword.

Example: Copy "C:\Data Directory\\.xls" TO /desktop

FILTER

/O

(no value)

Example: Copy FILTER

<filter>

Example: Copy FILTER *.(jpg|png)

shift

Copies with filtering enabled if the Shift key is held down. Opus will prompt you to define the filter.

Example: Copy FILTER=shift

alt

Copies with filtering enabled if the Alt key is held down.

Example: Copy FILTER=alt

ctrl

Copies with filtering enabled if the Ctrl key is held down.

Example: Copy FILTER=ctrl

FILTERDEF

/K/R

<filter>

This is a /R argument and so everything after the FILTERDEF keyword will be treated as the argument's value.

Example: Copy FILTERDEF name match *.zip and size match > 2 mb

FLATVIEWCOPY

/K

single

Example: Copy FLATVIEWCOPY=single

recreate

Example: Copy FLATVIEWCOPY=recreate

ask

Opus will ask you what to do when copying items out of a flat view file display.

Example: Copy FLATVIEWCOPY=ask

autosingle

When used with ask or recreate this specifies what to do when the items being copied come from multiple folders. If the items being copied all come from the same folder, it will act as if single was specified instead.

Example: Copy FLATVIEWCOPY=autosingle,recreate

FORCE

/S

(no value)

Automatically replace existing files without prompting. In-use files that cannot be replaced will be automatically scheduled for replacement next reboot.

Example: Copy FORCE

HERE

/S

(no value)

Use the source folder as the destination folder (for example, archives can be extracted to the same folder instead of the destination).

Example: Copy EXTRACT HERE

Important: The HERE argument can complicate buttons which run more than one command, as it can affect the destination folder used by subsequent commands in the same button. It is recommended to use TO={sourcepath$} instead if the button runs multiple commands.

Scripting: The HERE argument does not work when running commands via the scripting Command object. Instead, use cmd.SetDestTab(cmd.sourcetab) on the Command object, or use an explicit TO argument in the command string.

IGNOREEXT

/S

(no value)

Makes the copy function ignore file extensions when copying with a wildcard rename (for example, so a button can work on both files and folders using the same wildcard pattern).

Example: Copy * AS *.bak IGNOREEXT

INCLUDEINLIBRARY

/O

(no value)

Opus will automatically navigate to show the contents of the library with the newly included folder.

Example: Copy INCLUDEINLIBRARY

noread

Prevents Opus from automatically navigating to the library when you include a folder in it via the generated list.

Example: Copy INCLUDEINLIBRARY noread

$new

Include selected folders in a new library. The new library will be given the name of the first selected folder. Opus will automatically navigate to the new library unless you include the noread: prefix.

Example: Copy INCLUDEINLIBRARY noread:\$new

<library name>

Include selected folders in the named library. Opus will automatically navigate to the new library unless you include the noread: prefix.

Example: Copy INCLUDEINLIBRARY "noread:Movie Files"

INSTALLFONT

/O

(no value)

Installs new fonts in your system fonts folder. You do not need to specify the destination folder when using this command - the fonts will be copied to your fonts folder and registered automatically. This command has no effect if non-font files are selected. Fonts will be installed for all users (and so elevation will be required if UAC is enabled).

Example: Copy INSTALLFONT

user

Installs the new fonts for the current user only. Does not require elevation under UAC.

Example: Copy INSTALLFONT=user

MAKELINK

/O

(no value)

Creates shortcuts to all selected files and folders. Shortcuts do not require NTFS. Shortcuts may point to things on different drives to themselves.

Example: Copy MAKELINK TO /desktop

junction

Creates junctions to all selected folders. Junctions are only supported on NTFS drives. Junctions only work with folders (not with files). Junctions may point to folders on different drives to themselves.

Example: Copy MAKELINK=junction

hardlink

Creates hardlinks to all selected files. Hardlinks are only supported on NTFS drives. Hardlinks only work with files (not folders). Hardlinks cannot point to files on different drives to themselves.

Example: Copy MAKELINK=hardlink

softlink

Creates softlinks to all selected files or folders, using absolute paths. Softlinks require Windows Vista or above and are only supported on NTFS drives. Softlinks work with both files and folders. Softlinks may point to things on different drives to themselves. Creating softlinks requires administrator access and will trigger a UAC prompt if necessary.

Example: Copy MAKELINK=softlink

relsoftlink

Creates softlinks to any selected files or folders, using relative paths where possible. A regular absolute link will be created if the target can not be expressed relative to the link. (See softlink for more information on softlinks.)

Example: Copy MAKELINK=relsoftlink

auto

Automatically determines the most suitable type of link to create. On Vista and above, it will usually create softlinks (for both files and folders). On Windows XP, it will usually create junctions (for folders) and hardlinks (for files). Shortcuts will be created instead in cases where the desired link type is not applicable. For example, a shortcut will be created if the drives are not NTFS or if a hardlink is desired but the source and destination are on different drives.

Example: Copy MAKELINK=auto

autonosoft

Does the same as auto except that it will not try to create softlinks. It will usually create junctions (for folders) and hardlinks (for files). Shortcuts will be created instead in cases where the desired link type is not applicable. For example, a shortcut will be created if the drives are not NTFS or for files where the source and destination are on different drives.

Example: Copy MAKELINK=autonosoft

MAKESFX

/O

(no value)

Example: Copy MAKESFX

MARKDESTARCHIVE

/K

yes

Clears the A ("ready for archiving") attribute on newly copied files. You can use this if your backup solution uses the A attribute to indicate a file has changes which need backing up, and you don't want the new copy to be backed up (until something modifies it and sets its A attribute again).

This does nothing if not preserving file attributes on copied files.

Example: Copy MARKDESTARCHIVE=yes

no

Do not clear the A attribute on newly copied files.

Example: Copy MARKDESTARCHIVE=no

MARKSOURCEARCHIVE

/K

yes

Clear the A ("ready for archiving") attribute on the original files after they have been copied. You can use this if your backup solution uses the A attribute to indicate a file has changes which need backing up, and you don't want the original files to be backed up.

Example: Copy MARKSOURCEARCHIVE=yes

no

Do not clear the A attribute on the original files after they are copied.

Example: Copy MARKSOURCEARCHIVE=no

MOVE

/S

(no value)

Move selected files and folders to the destination (a.k.a. cut-and-paste). If the destination folder is on the same drive as the source then generally items can be moved through a simple rename operation, which is very quick. When moving files between devices Opus first copies them to the destination, and then deletes them from the source.

Example: Copy MOVE

MOVEWHENSAME

/S

(no value)

Example: Copy MOVEWHENSAME

MOVEWITHSHIFT

/S

(no value)

Selected items will be moved if the Shift key is held down when the command is executed, otherwise they will be copied.

Example: Copy MOVEWITHSHIFT

NONBUFIO

/K

yes

Changes when the copy operation uses non-buffered mode, where the filesystem buffers provided by Windows are bypassed.

For very large files, copying in non-buffered mode can increase the memory efficiency, copy speed and UI responsiveness. On the other hand, non-buffered mode may slow things down for smaller files or certain devices. In rare cases, non-buffered mode may not work at all (e.g. if you have a device which mis-reports its sector size).

You can specify "yes" or "no" to force non-buffered mode on or off for all files, or specify the file size above which non-buffered mode should be used.

Example: Copy NONBUFIO=yes

This has no effect when doing simple file-to-file copies and delegating to the very-high-level Windows file-copy API, since that API performs its own buffering. See the DELEGATE argument for more detail.

no

Example: Copy NONBUFIO=no

<threshold size>

The copy operation will be non-buffered if the file size exceeds the specified size, and buffered otherwise. When specifying a size, units can be KB, MB or GB. If no units are specified, MB is used by default.

Example: Copy NONBUFIO=64MB

NOQUEUEWHENSAME

/S

(no value)

Disables the use of the copy queue when the source and destination paths are on the same drive partition. You would normally only use this argument when moving files, because moves on the same drive can be done without actually copying any data.

Example: Copy MOVE NOQUEUEWHENSAME

PATTERN

/K

<old name pattern>

Example: Copy DUPLICATE PATTERN *.* AS *_{date|yyyy-MM-dd}.*

QUEUE

/O

(no value)

Example: Copy QUEUE

<queue name>

When you specify a queue name as the value for this argument, it enables manual copy queuing when copying files. That is, with a name specified, file copies will always be queued to the specified queue - if no name is specified for the argument, copies will only be queued if needed. The specified name will be shown in the progress dialog's title bar.

Example: Copy QUEUE=MyQueue

none

Used to disable copy queuing - whether enabled in Preferences, or otherwise enabled by the shift keyword.

Example: Copy QUEUE=none

shift

Lets you specify two alternate parameters for the QUEUE argument. The value specified before the shift keyword is used if the Shift key is not held down - the value after it is used if it is. For example, you could configure a copy button to queue files to a specific queue if the Shift key were held down, and to disable queuing otherwise.

Example: Copy QUEUE=none,shift,MyQueue TO \\NAS1\Storage

quiet

Specify the quiet keyword to suppress the prompt that normally indicates a copy operation has been queued. (Opus 13.9.1 and above: You can also turn off Display confirmation when a job is queued in Preferences.)

Example: Copy QUEUE=MyQueue,quiet

noisy

(Opus 13.9.1 and above.) Specify the noisy keyword to always show a prompt indicating a copy operation has been queued, even if Display confirmation when a job is queued is off in Preferences.

Example: Copy QUEUE=MyQueue,noisy

RENAMEWHENSAME

/S

(no value)

If the source and destination are the same folder, the newly copied file will be automatically renamed to avoid a clash.

Example: Copy RENAMEWHENSAME

SENDMAIL

/O

(no value)

Example: Copy SENDMAIL

<email address>

Example: Copy SENDMAIL=f.bloggs@company.com

SENDTO

/K

<send-to target>

Example: Copy SENDTO "Web Publishing Wizard"

SYNC

/S

(no value)

TO

/K

<target path>

Example: Copy TO "lib://Backups/Daily Backup Folder"

ask

Normally if no destination path is specified, and there is no current destination file display or Lister, Opus will prompt for a destination path via a popup dialog. You can use the ask value to force Opus to always prompt for a destination path, even if there already is one.

You can also specify a default destination path, by appending a colon and the path. Remember to use quotes if the path contains spaces.

Example: Copy TO=ask Example: Copy TO="ask:c:\My Documents"

ask$

Force Opus to ask for a destination path. If you have a function that combines multiple Copy commands, you can use ask$ to make Opus only prompt for a destination path once for the whole function, rather than prompting separately for each Copy command.

You can also specify a default destination path, by appending a colon and the path.

Example: Copy TO=ask\$ ``Copy TO=ask$:D:\`

UNATTENDED

/K

yes

Example: Copy UNATTENDED=yes TO=@myftpsite WHENEXISTS=replace

no

Disables unattended copy mode.

Example: Copy UNATTENDED=no

UPDATEALL

/S

(no value)

(Compare this with UPDATEEXISTING which only updates files that already exist.)

A file is defined as different if either its timestamp is newer or its size has changed - the contents of the file are not compared.

Example: Copy UPDATEALL FORCE

date

Update existing files whose timestamp is different (ignore file size).

Example: Copy UPDATEALL=date

size

Update existing files whose size is different (ignore timestamp).

Example: Copy UPDATEALL=size

smaller

When used with size, only updates files whose size is smaller (rather than just different).

Example: Copy UPDATEALL=size,smaller

larger

When used with size, only updates files whose size is larger..

Example: Copy UPDATEALL=size,larger

UPDATEEXISTING

/O

(no value)

(Compare this with UPDATEALL which also copies files that don't already exist.)

A file is defined as different if either its timestamp is newer or its size has changed.

Example: Copy UPDATEEXISTING

date

Update existing files whose timestamp is different (ignore file size).

Example: Copy UPDATEEXISTING=date

size

Update existing files whose size is different (ignore timestamp).

Example: Copy UPDATEEXISTING=size

smaller

When used with size, only updates files whose size is smaller (rather than just different).

Example: Copy UPDATEEXISTING=size,smaller

larger

When used with size, only updates files whose size is larger..

Example: Copy UPDATEEXISTING=size,larger

UPDATESECURITY

/K

yes

Update security permissions and encryption settings for moved* files to match their destination folders.

For example, if a folder has the E attribute set, files moved into that folder will be automatically encrypted.

This only applies to files moved between folders on the same logical drive. For files that are moved between drives, the operation is done via a copy-then-delete and the newly copied files will usually inherit the permissions of the destination folder by default (unless overridden by the separate COPYSECURITY argument or related Preferences setting).

Example: Copy UPDATESECURITY=yes

no

Do not update security permissions or encryption settings for files moved between folders on the same logical drive. Such files will instead retain the permissions they had in their original folders.

Example: Copy UPDATESECURITY=no

UPDATETOLERANCE

/K/N

<tolerance seconds>

Sets the maximum number of seconds an existing file's timestamp can vary before it will be considered "different" by the UPDATEALL or UPDATEEXISTING functions. The default is two seconds (that is, a file will be considered different if its timestamp is two or more seconds different to the source file). You can use this to make allowances for daylight-savings time, or for file systems that don't preserve file dates to a high enough resolution.

Example: Copy UPDATEEXISTING UPDATETOLERANCE=3600

WHENEXISTS

/K

ask

Example: Copy WHENEXISTS=ask

skip

If a file that is being copied already exists in the destination, skip over it (leaving existing file intact).

Example: Copy WHENEXISTS=skip

recycle

When replacing a file, delete the original to the recycle bin if possible. You can combine this flag with the other options.

Note that Undo can not be used to restore these files automatically, however you will be able to retrieve them from the recycle bin manually.

Example: Copy WHENEXISTS=replace,recycle

replace

Replace any existing files without prompting.

Example: Copy WHENEXISTS=replace

rename

If a file with the same name already exists in the destination, the newly copied file will be renamed automatically to avoid a clash.

Example: Copy WHENEXISTS=rename

renameold

The old file (the one that already exists in the destination directory) will be renamed before the new file is copied.

Example: Copy WHENEXISTS=renameold

resume

When copying to FTP sites, a previous incomplete file transfer will be automatically resumed (only applies if the server supports FTP, and the existing file is smaller than the one being copied).

Example: Copy WHENEXISTS=resume

merge

Example: Copy WHENEXISTS=replace,merge

keepnewer

Replace any existing files if the files being copied are newer. If the timestamps are the same or older, the already-existing files will be skipped.

Example: Copy WHENEXISTS=keepnewer

最后更新于