xcopy

Windows CMD · Files · available in the simulator

What it does

Copies files and directory trees.

Syntax

xcopy origen [destino] [opciones]

Options and parameters

  • /E

    Copies directories and subdirectories, including empty ones.

    xcopy src dest /E /I
  • /S

    Copies subdirectories, except empty ones.

  • /I

    If destination does not exist and copying multiple files, assumes destination is a directory.

  • /Y

    Suppresses prompting to confirm overwriting an existing destination file.

  • /-Y

    Prompts to confirm overwriting an existing destination file.

  • /Q

    Suppresses the display of file names while copying.

  • /F

    Displays full source and destination file names while copying.

  • /L

    Displays the files that would be copied without actually copying them.

  • /H

    Copies hidden and system files as well.

  • /R

    Overwrites read-only files.

  • /T

    Copies the directory structure without copying files.

  • /U

    Copies only files that already exist in the destination.

  • /K

    Retains read-only attributes on copied files.

  • /D

    Copies only files modified on or after the specified date, or newer than destination files.

    xcopy src dest /D:01-01-2026
  • /A

    Copies only files with the archive attribute set, without resetting it.

  • /M

    Copies files with the archive attribute set and turns off the archive attribute.

  • /C

    Continues copying even if errors occur.

  • /W

    Prompts you to press a key before copying begins.

  • /P

    Prompts for confirmation before creating each destination file.

  • /Z

    Copies networked files in restartable mode.

  • /J

    Copies using unbuffered I/O; useful for very large files.

  • /B

    Copies the symbolic link instead of the target file.

  • /G

    Allows copying encrypted files to a destination that does not support encryption.

  • /EXCLUDE

    Excludes files listed in the specified files.

    xcopy src dest /E /EXCLUDE:lista.txt

Usage examples

  • xcopy src dest /E /I
  • xcopy *.txt backup /S /Y
  • xcopy src dest /D:01-01-2026
  • xcopy src dest /E /EXCLUDE:lista.txt
Practise xcopy

Related commands