How to Copy Files from One Directory to Another Using CMD

Last Updated : 5 Dec, 2025

Copying files between folders is one of the most common tasks on a PC. While File Explorer works fine for simple jobs, the Command Prompt (CMD) gives you a quicker, more powerful way to copy files especially when dealing with large batches, automation, or repeated tasks.

Key Highlights:

  • Perform file transfers faster than using File Explorer
  • Copy large batches of files with a single command
  • Automate repetitive tasks using CMD or batch scripts
  • Use advanced options like copying hidden files, subfolders, and network-friendly transfers

Part 1: How to Copy a Single File Using CMD

Follow these steps to copy one file from one directory to another

Step 1: Open Command Prompt

  • Press Win + R, type cmd, and hit Enter.
Open-a-Command-Prompt---01
Open a Command Prompt - 01

Step 2: Navigate to the File Location

Use the cd command:

cd path\to\your\folder

Step 2: View Files in the Directory

Run:

dir

Copy-Files---01
Copy Files - 01

Step 3: Copy the File

Use the copy command:

copy <filename> <destination>
Copy-Files---02
Copy Files - 02

Note: Copying to system folders may fail unless CMD is opened with admin rights.

Part 2: How to Copy Multiple Files Using CMD

For bulk copying, Windows provides the XCOPY command, which supports subfolders, hidden files, and large operations.

Step 1: Open Command Prompt as Administrator

  • Search CMD, right-click → Run as administrator.

Step 2: Use the XCOPY Command

  • Use the following format:
xcopy <source> <destination> /s /e

This copies all files, subdirectories, and empty folders.

Copy-Multiple-Files---01
Copy Multiple Files - 01

XCOPY Command Options (Quick Reference Table)

ParameterDescription
Path of the file or folder to copy
Path where files should be copied
/wPause before copying; waits for user input
/pAsks before creating each destination file
/cContinues copying even if errors occur
/vVerifies copied files
/fShows full source and destination paths while copying
/gCreates a list of files to be copied
/sCopies directories and subdirectories (except empty ones)
/eCopies all subdirectories, including empty ones
/rCopies read-only files
/hIncludes hidden and system files
/zEnables restartable mode (useful for network transfers)
/?Displays XCOPY help menu
Comment