Copy-File

This command copies one or more files from a source directory to the destination directory. The method of operation and the syntax that can be used are the same as the Windows shell command COPY (use of placeholders and environment variables). Additionally, any variables can be used like.


Settings:

  • Paths
    • Source file(s)
      Specifies the files to be copied including the path. Wildcards * and ? as well as variables are allowed. Use the "..." button to select an existing file (on the packaging system) or enter the path manually.
    • Target file(s)
      Specifies the target file(s) including path. If you want to keep the file name(s), specify only the destination directory (the last character must be a backslash "\"). Use the "..." button to select an existing file (on the packaging system) or specify the path manually.
    • Include subdirectories
      Determines whether files in subdirectories should also be copied. This is particularly relevant when using wildcards.
    • Use 32-Bit mode on x64 computer
      If the script is executed on a 64-bit operating system, the counterpart for 32-bit applications SysWOW64 can be used automatically when referring to the SYSTEM32 directory.
  • Replacement options
    • Always replace
      Specifies that existing files with the same name are always overwritten.
    • Replace only older versions
      This is the default option and specifies that existing files with the same name are only overwritten if they are older than the file to be copied.
    • Never replace
      Specifies that existing files with the same name are never overwritten.
    • Confirm replace
      Existing files with the same name are only overwritten if the user confirms this.
  • Backup
    • Create backup files
      When files are replaced by the copy operation, a backup copy of the existing files is created.


Example:

The following example copies all log files from the Windows directory and all subdirectories into the directory C:\Temp.


Corresponds to DSM eScript command:

  • Copy


See also: