βΉοΈ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.6 months ago (distributed domain, exempt) |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy |
| Last Crawled | 2026-03-20 10:58:06 (17 days ago) |
| First Indexed | 2022-09-17 04:03:52 (3 years ago) |
| HTTP Status Code | 200 |
| Meta Title | copy | Microsoft Learn |
| Meta Description | Reference article for the copy command, which copies one or more files from one location to another. |
| Meta Canonical | null |
| Boilerpipe Text | Copies one or more files from one location to another.
copy [/d] [/v] [/n] [/y | /-y] [/z] [/a | /b] <source> [/a | /b] [+<source> [/a | /b] [+ ...]] [<destination> [/a | /b]]
Parameter
Description
/d
Allows the encrypted files being copied to be saved as decrypted files at the destination.
/v
Verifies that new files are written correctly.
/n
Uses a short file name, if available, when copying a file with a name longer than eight characters, or with a file name extension longer than three characters.
/y
Suppresses prompting to confirm that you want to overwrite an existing destination file.
/-y
Prompts you to confirm that you want to overwrite an existing destination file.
/z
Copies networked files in restartable mode.
/a
Indicates an ASCII text file.
/b
Indicates a binary file.
<source>
Required. Specifies the location from which you want to copy a file or set of files.
Source
can consist of a drive letter and colon, a directory name, a file name, or a combination of these.
<destination>
Required. Specifies the location to which you want to copy a file or set of files.
Destination
can consist of a drive letter and colon, a directory name, a file name, or a combination of these.
/?
Displays help at the command prompt.
You can copy an ASCII text file that uses an end-of-file character (CTRL+Z) to indicate the end of the file.
If
/a
precedes or follows a list of files on the command line, it applies to all files listed until
copy
encounters
/b
. In this case,
/b
applies to the file preceding
/b
.
The effect of
/a
depends on its position in the command-line string:
- If
/a
follows
source
, the
copy
command treats the file as an ASCII file and copies data that precedes the first end-of-file character (CTRL+Z).
- If
/a
follows
destination
, the
copy
command adds an end-of-file character (CTRL+Z) as the last character of the file.
If
/b
directs the command interpreter to read the number of bytes specified by the file size in the directory.
/b
is the default value for
copy
, unless
copy
combines files.
If
/b
precedes or follows a list of files on the command line, it applies to all listed files until
copy
encounters
/a
. In this case,
/a
applies to the file preceding
/a
.
The effect of
/b
depends on its position in the command-line string:
- If
/b
follows
source
, the
copy
command copies the entire file, including any end-of-file character (CTRL+Z).
- If
/b
follows
destination
, the
copy
command doesn't add an end-of-file character (CTRL+Z).
If a write operation cannot be verified, an error message appears. Although recording errors rarely occur with the
copy
command , you can use
/v
to verify that critical data has been correctly recorded. The
/v
command-line option also slows down the
copy
command, because each sector recorded on the disk must be checked.
If
/y
is preset in the
COPYCMD
environment variable, you can override this setting by using
/-y
at the command line. By default, you are prompted when you replace this setting, unless the
copy
command is executed in a batch script.
To append files, specify a single file for
destination
, but multiple files for
source
(use wildcard characters or
file1
+
file2
+
file3
format).
If the connection is lost during the copy phase (for example, if the server going offline breaks the connection), you can use
copy /z
to resume after the connection is re-established. The
/z
option also displays the percentage of the copy operation that is completed for each file.
You can substitute a device name for one or more occurrences of
source
or
destination
.
If
destination
is a device (for example, Com1 or Lpt1), the
/b
option copies data to the device in binary mode. In binary mode,
copy /b
copies all characters (including special characters such as CTRL+C, CTRL+S, CTRL+Z, and ENTER) to the device, as data. However, if you omit
/b
, the data is copied to the device in ASCII mode. In ASCII mode, special characters might cause files to combine during the copying process.
If you don't specify a destination file, a copy is created with the same name, modified date, and modified time as the original file. The new copy is stored in the current directory on the current drive. If the source file is on the current drive and in the current directory and you do not specify a different drive or directory for the destination file, the
copy
command stops and displays the following error message:
File cannot be copied onto itself
0 File(s) copied
If you specify more than one file in
source
, the
copy
command combines them all into a single file using the file name specified in
destination
. The
copy
command assumes the combined files are ASCII files unless you use the
/b
option.
To copy files that are 0 bytes long, or to copy all of a directory's files and subdirectories, use the
xcopy command
.
To assign the current time and date to a file without modifying the file, use the following syntax:
copy /b <source> +,,
Where the commas indicate that the
destination
parameter has been intentionally left out.
To copy a file called
memo.doc
to
letter.doc
in the current drive and ensure that an end-of-file character (CTRL+Z) is at the end of the copied file, type:
copy memo.doc letter.doc /a
To copy a file named
robin.typ
from the current drive and directory to an existing directory named
Birds
that is located on drive C, type:
copy robin.typ c:\birds
Note
If the
Birds
directory doesn't exist, the file
robin.typ
is copied into a file named
Birds
that is located in the root directory on the disk in drive C.
To combine
Mar89.rpt
,
Apr89.rpt
, and
May89.rpt
, which are located in the current directory, and place them in a file named
Report
(also in the current directory), type:
copy mar89.rpt + apr89.rpt + may89.rpt Report
Note
If you combine files, the
copy
command marks the destination file with the current date and time. If you omit
destination
, the files are combined and stored under the name of the first file in the list.
To combine all files in
Report
, when a file named
Report
already exists, type:
copy report + mar89.rpt + apr89.rpt + may89.rpt
To combine all files in the current directory that have the .txt file name extension into a single file named
Combined.doc
, type:
copy *.txt Combined.doc
To combine several binary files into one file by using wildcard characters, include
/b
. This prevents Windows from treating CTRL+Z as an end-of-file character. For example, type:
copy /b *.exe Combined.exe
Caution
If you combine binary files, the resulting file might be unusable due to internal formatting.
Combining each file that has a .txt extension with its corresponding .ref file creates a file with the same file name, but with a .doc extension. The
Copy
command combines
file1.txt
with
file1.ref
to form
file1.doc
, and then the command combines
file2.txt
with
file2.ref
to form
file2.doc
, and so on. For example, type:
copy *.txt + *.ref *.doc
To combine all files with the .txt extension, and then to combine all files with the .ref extension into one file named
Combined.doc
, type:
copy *.txt + *.ref Combined.doc
Command-Line Syntax Key
xcopy command |
| Markdown | [Skip to main content](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy#main) [Skip to Ask Learn chat experience](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy)
## Microsoft Build 2026
June 2-3, 2026
Go deep on real code and real systems in San Francisco and online
[Learn more](https://aka.ms/MSBuild_FY26_BN_MSLearn_Hero)
Dismiss alert
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
[Download Microsoft Edge](https://go.microsoft.com/fwlink/p/?LinkID=2092881%20) [More info about Internet Explorer and Microsoft Edge](https://learn.microsoft.com/en-us/lifecycle/faq/internet-explorer-microsoft-edge)
[Learn](https://learn.microsoft.com/en-us/)
[Sign in](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy)
![]()
![]()
- [Profile](https://learn.microsoft.com/en-us/users/me/activity/)
- [Settings](https://learn.microsoft.com/en-us/users/me/settings/)
[Sign out](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy)
[Learn](https://learn.microsoft.com/en-us/)
- Documentation
- [All product documentation](https://learn.microsoft.com/en-us/docs/)
- [Azure documentation](https://learn.microsoft.com/en-us/azure/?product=popular)
- [Dynamics 365 documentation](https://learn.microsoft.com/en-us/dynamics365/)
- [Microsoft Copilot documentation](https://learn.microsoft.com/en-us/copilot/)
- [Microsoft 365 documentation](https://learn.microsoft.com/en-us/microsoft-365/)
- [Power Platform documentation](https://learn.microsoft.com/en-us/power-platform/)
- [Code samples](https://learn.microsoft.com/en-us/samples/)
- [Troubleshooting documentation](https://learn.microsoft.com/en-us/troubleshoot/)
Free to join. Request to attend.
[Microsoft AI Tour](https://aitour.microsoft.com/?wt.mc_id=itour26_learnmarketingspot_wwl)
Take your business to the AI frontier.
- Training & Labs
- [All training](https://learn.microsoft.com/en-us/training/)
- [Azure training](https://learn.microsoft.com/en-us/training/browse/?products=azure)
- [Dynamics 365 training](https://learn.microsoft.com/en-us/training/browse/?products=dynamics-365)
- [Microsoft Copilot training](https://learn.microsoft.com/en-us/training/browse/?products=ms-copilot)
- [Microsoft 365 training](https://learn.microsoft.com/en-us/training/browse/?products=m365)
- [Microsoft Power Platform training](https://learn.microsoft.com/en-us/training/browse/?products=power-platform)
- [Labs](https://learn.microsoft.com/en-us/labs/)
- [Credentials](https://learn.microsoft.com/en-us/credentials/)
- [Career paths](https://learn.microsoft.com/en-us/training/career-paths/)
Free to join. Request to attend.
[Microsoft AI Tour](https://aitour.microsoft.com/?wt.mc_id=itour26_learnmarketingspot_wwl)
Take your business to the AI frontier.
- Q\&A
- [Ask a question](https://learn.microsoft.com/en-us/answers/questions/ask/)
- [Azure questions](https://learn.microsoft.com/en-us/answers/tags/133/azure/)
- [Windows questions](https://learn.microsoft.com/en-us/answers/tags/60/windows/)
- [Microsoft 365 questions](https://learn.microsoft.com/en-us/answers/tags/9/m365/)
- [Microsoft Outlook questions](https://learn.microsoft.com/en-us/answers/tags/131/office-outlook/)
- [Microsoft Teams questions](https://learn.microsoft.com/en-us/answers/tags/108/office-teams/)
- [Popular tags](https://learn.microsoft.com/en-us/answers/tags/)
- [All questions](https://learn.microsoft.com/en-us/answers/questions/)
Free to join. Request to attend.
[Microsoft AI Tour](https://aitour.microsoft.com/?wt.mc_id=itour26_learnmarketingspot_wwl)
Take your business to the AI frontier.
- Topics
- [Artificial intelligence](https://learn.microsoft.com/en-us/ai/)
Learning hub to build AI skills
- [Compliance](https://learn.microsoft.com/en-us/compliance/)
Compliance resources you need to get started with your business
- [DevOps](https://learn.microsoft.com/en-us/devops/)
DevOps practices, Git version control and Agile methods
- [Learn for Organizations](https://learn.microsoft.com/en-us/training/organizations/)
Curated offerings from Microsoft to boost your teamβs technical skills
- [Platform engineering](https://learn.microsoft.com/en-us/platform-engineering/)
Tools from Microsoft and others to build personalized developer experiences
- [Security](https://learn.microsoft.com/en-us/security/)
Guidance to help you tackle security challenges
- [Assessments](https://learn.microsoft.com/en-us/assessments/)
Interactive guidance with custom recommendations
- [Student hub](https://learn.microsoft.com/en-us/training/student-hub/)
Self-paced and interactive training for students
- [Educator center](https://learn.microsoft.com/en-us/training/educator-center/)
Resources for educators to bring technical innovation in their classroom
Free to join. Request to attend.
[Microsoft AI Tour](https://aitour.microsoft.com/?wt.mc_id=itour26_learnmarketingspot_wwl)
Take your business to the AI frontier.
[Sign in](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy)
![]()
![]()
- [Profile](https://learn.microsoft.com/en-us/users/me/activity/)
- [Settings](https://learn.microsoft.com/en-us/users/me/settings/)
[Sign out](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy)
[Windows Server](https://learn.microsoft.com/en-us/windows-server/)
- [Get started](https://learn.microsoft.com/en-us/windows-server/get-started/get-started-with-windows-server)
- Learn Windows Server
- [Browse all training](https://learn.microsoft.com/en-us/training/browse/?products=windows-server)
- [Instructor-led courses](https://learn.microsoft.com/en-us/training/browse/?resource_type=course&products=windows-server)
- [Earn credentials](https://learn.microsoft.com/en-us/credentials/browse/?products=windows-server)
- [Troubleshooting](https://learn.microsoft.com/en-us/troubleshoot/windows-server/welcome-windows-server)
- [Previous versions documentation](https://learn.microsoft.com/en-us/previous-versions/windows/)
- Resources
- [Extended Security Updates](https://learn.microsoft.com/en-us/windows-server/extended-security-updates)
- [Windows Server Tech Community](https://techcommunity.microsoft.com/t5/windows-server/ct-p/Windows-Server)
- [Windows Server Blog](https://www.microsoft.com/windows-server/blog/)
- [Windows Server datasheet](https://go.microsoft.com/fwlink/?linkid=2299415)
- More
- [Get started](https://learn.microsoft.com/en-us/windows-server/get-started/get-started-with-windows-server)
- Learn Windows Server
- [Browse all training](https://learn.microsoft.com/en-us/training/browse/?products=windows-server)
- [Instructor-led courses](https://learn.microsoft.com/en-us/training/browse/?resource_type=course&products=windows-server)
- [Earn credentials](https://learn.microsoft.com/en-us/credentials/browse/?products=windows-server)
- [Troubleshooting](https://learn.microsoft.com/en-us/troubleshoot/windows-server/welcome-windows-server)
- [Previous versions documentation](https://learn.microsoft.com/en-us/previous-versions/windows/)
- Resources
- [Extended Security Updates](https://learn.microsoft.com/en-us/windows-server/extended-security-updates)
- [Windows Server Tech Community](https://techcommunity.microsoft.com/t5/windows-server/ct-p/Windows-Server)
- [Windows Server Blog](https://www.microsoft.com/windows-server/blog/)
- [Windows Server datasheet](https://go.microsoft.com/fwlink/?linkid=2299415)
[Get Windows Server](https://www.microsoft.com/windows-server) [Free trial](https://www.microsoft.com/evalcenter/evaluate-windows-server-2025?icid=msft_learn)
- [Windows Commands](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands)
- [Command-Line Syntax Key](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/command-line-syntax-key)
- Reference
- Commands by Server Role
- [adprep](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/adprep)
- [append](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/append)
- [arp](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/arp)
- [assoc](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/assoc)
- [at](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/at)
- [atmadm](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/atmadm)
- [attrib](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/attrib)
- auditpol
- [autochk](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/autochk)
- [autoconv](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/autoconv)
- [autofmt](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/autofmt)
- [bcdboot](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/bcdboot)
- [bcdedit](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/bcdedit)
- bdehdcfg
- bitsadmin
- bootcfg
- [break](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/break)
- [cacls](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cacls)
- [call](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/call)
- [cd](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cd)
- [certreq](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/certreq_1)
- [certutil](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/certutil)
- change
- [chcp](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/chcp)
- [chdir](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/chdir)
- [chglogon](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/chglogon)
- [chgport](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/chgport)
- [chgusr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/chgusr)
- [chkdsk](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/chkdsk)
- [chkntfs](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/chkntfs)
- [choice](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/choice)
- [cipher](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cipher)
- [cleanmgr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cleanmgr)
- [clip](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/clip)
- [cls](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cls)
- [cmd](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmd)
- [cmdkey](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmdkey)
- [cmstp](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cmstp)
- [color](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/color)
- [comp](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/comp)
- [compact](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/compact)
- [copy](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy)
- [cscript](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/cscript)
- [date](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/date)
- [dcdiag](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dcdiag)
- [dcgpofix](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dcgpofix)
- [dcpromo](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dcpromo)
- [defrag](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/defrag)
- [del](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/del)
- dfsdiag
- [dfsrmig](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dfsrmig)
- [dfsutil](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dfsutil)
- [diantz](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/diantz)
- [dir](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dir)
- [diskcomp](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/diskcomp)
- [diskcopy](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/diskcopy)
- [diskpart](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/diskpart)
- diskpart scripts and examples
- [diskperf](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/diskperf)
- [diskraid](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/diskraid)
- diskshadow
- [dispdiag](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dispdiag)
- [dnscmd](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dnscmd)
- [doskey](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/doskey)
- [driverquery](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/driverquery)
- [dtrace](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dtrace)
- [echo](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/echo)
- [edit](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/edit)
- [endlocal](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/endlocal)
- [erase](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/erase)
- [eventcreate](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/eventcreate)
- [evntcmd](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/evntcmd)
- [expand](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/expand)
- [extract](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/extract)
- [fc](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fc)
- [find](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/find)
- [findstr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/findstr)
- [finger](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/finger)
- [flattemp](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/flattemp)
- [fondue](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fondue)
- [for](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/for)
- [forfiles](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/forfiles)
- [freedisk](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/freedisk)
- fsutil
- ftp
- [ftype](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ftype)
- [fveupdate](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fveupdate)
- [getmac](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/getmac)
- [gettype](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/gettype)
- [goto](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/goto)
- [gpfixup](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/gpfixup)
- [gpresult](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/gpresult)
- [gpupdate](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/gpupdate)
- [graftabl](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/graftabl)
- [help](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/help)
- [helpctr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/helpctr)
- [hostname](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/hostname)
- [icacls](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/icacls)
- [if](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/if)
- [ipconfig](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ipconfig)
- [ipxroute](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ipxroute)
- [irftp](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/irftp)
- [jetpack](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/jetpack)
- [klist](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/klist)
- ksetup
- [ktmutil](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ktmutil)
- [ktpass](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ktpass)
- [label](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/label)
- [lodctr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/lodctr)
- logman
- [logoff](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/logoff)
- [lpq](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/lpq)
- [lpr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/lpr)
- [macfile](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/macfile)
- [makecab](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/makecab)
- manage bde
- [mapadmin](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mapadmin)
- [md](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/md)
- [mkdir](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mkdir)
- [mklink](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mklink)
- [mmc](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mmc)
- [mode](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mode)
- [more](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/more)
- [mount](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mount)
- [mountvol](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mountvol)
- [move](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/move)
- [mqbkup](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mqbkup)
- [mqsvc](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mqsvc)
- [mqtgsvc](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mqtgsvc)
- [msdt](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/msdt)
- [msg](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/msg)
- [msiexec](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/msiexec)
- [msinfo32](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/msinfo32)
- [mstsc](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mstsc)
- [nbtstat](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/nbtstat)
- [net print](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/net-print)
- [net user](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/net-user)
- [netcfg](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/netcfg)
- netdom
- network shell (netsh)
- [netstat](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/netstat)
- [nfsadmin](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/nfsadmin)
- [nfsshare](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/nfsshare)
- [nfsstat](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/nfsstat)
- [nlbmgr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/nlbmgr)
- nslookup
- [ntbackup](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ntbackup)
- [ntcmdprompt](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ntcmdprompt)
- [ntfrsutl](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ntfrsutl)
- [openfiles](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/openfiles)
- [pagefileconfig](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pagefileconfig)
- [path](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/path)
- [pathping](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pathping)
- [pause](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pause)
- [pbadmin](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pbadmin)
- [pentnt](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pentnt)
- [perfmon](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/perfmon)
- [ping](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ping)
- pktmon
- [pnpunattend](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pnpunattend)
- [pnputil](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pnputil)
- [popd](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/popd)
- [powershell](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/powershell)
- [powershell ise](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/powershell_ise)
- [print](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/print)
- [prncnfg](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/prncnfg)
- [prndrvr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/prndrvr)
- [prnjobs](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/prnjobs)
- [prnmngr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/prnmngr)
- [prnport](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/prnport)
- [prnqctl](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/prnqctl)
- [prompt](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/prompt)
- [pubprn](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pubprn)
- [pushd](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pushd)
- [pushprinterconnections](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pushprinterconnections)
- [pwlauncher](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/pwlauncher)
- [qappsrv](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/qappsrv)
- [qprocess](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/qprocess)
- query
- [quser](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/quser)
- [qwinsta](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/qwinsta)
- [rd](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rd)
- [rdpsign](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rdpsign)
- [recover disk group](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/recover_1)
- refsutil
- reg
- [regini](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/regini)
- [regsvr32](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/regsvr32)
- [relog](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/relog)
- [ren](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ren)
- [rename](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rename)
- [repair bde](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/repair-bde)
- [replace](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/replace)
- [rexec](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rexec)
- [risetup](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/risetup)
- [rmdir](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rmdir)
- [robocopy](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy)
- [route ws2008](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/route_ws2008)
- [rpcinfo](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rpcinfo)
- [rpcping](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rpcping)
- [rsh](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rsh)
- [rundll32](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rundll32)
- [rundll32 printui](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rundll32-printui)
- [rwinsta](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rwinsta)
- [sc config](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-config)
- [sc create](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-create)
- [sc delete](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-delete)
- [sc query](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sc-query)
- schtasks
- scwcmd
- secedit
- [serverceipoptin](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/serverceipoptin)
- [servermanagercmd](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/servermanagercmd)
- [serverweroptin](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/serverweroptin)
- [Services for Network File System (NFS) command reference](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/services-for-network-file-system-command-reference)
- [set environmental variables](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/set_1)
- [setlocal](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setlocal)
- [setspn](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setspn)
- [setx](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setx)
- [sfc](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sfc)
- [shadow](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/shadow)
- [shift](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/shift)
- [showmount](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/showmount)
- [shutdown](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/shutdown)
- [simulate restore](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/simulate-restore)
- [sort](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sort)
- [start](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/start)
- [subst](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/subst)
- [sxstrace](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sxstrace)
- [sysmon](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sysmon)
- [sysocmgr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sysocmgr)
- [systeminfo](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/systeminfo)
- [takeown](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/takeown)
- tapicfg
- [taskkill](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/taskkill)
- [tasklist](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tasklist)
- [tcmsetup](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tcmsetup)
- telnet
- [tftp](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tftp)
- [time](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/time)
- [timeout](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/timeout)
- [title](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/title)
- [tlntadmn](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tlntadmn)
- [tpmtool](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tpmtool)
- [tpmvscmgr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tpmvscmgr)
- [tracerpt](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tracerpt)
- [tracert](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tracert)
- [tree](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tree)
- [tscon](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tscon)
- [tsdiscon](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tsdiscon)
- [tsecimp](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tsecimp)
- [tskill](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tskill)
- [tsprof](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tsprof)
- [type](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/type)
- [typeperf](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/typeperf)
- [tzutil](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/tzutil)
- [unlodctr](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/unlodctr)
- [ver](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ver)
- [verifier](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/verifier)
- [verify](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/verify)
- [vol](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/vol)
- vssadmin
- [waitfor](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/waitfor)
- wbadmin
- wdsutil
- [wecutil](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/wecutil)
- [wevtutil](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/wevtutil)
- [where](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/where)
- [whoami](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/whoami)
- [winnt](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/winnt)
- [winnt32](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/winnt32)
- [winrs](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/winrs)
- [winsat mem](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/winsat-mem)
- [winsat mfmedia](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/winsat-mfmedia)
- [wmic](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/wmic)
- [wscript](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/wscript)
- [xcopy](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy)
Download PDF
Table of contents
Exit editor mode
1. [Learn](https://learn.microsoft.com/en-us/)
2. [Windows Server](https://learn.microsoft.com/en-us/windows-server/)
3. [Windows commands](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands/)
1. [Learn](https://learn.microsoft.com/en-us/)
2. [Windows Server](https://learn.microsoft.com/en-us/windows-server/)
3. [Windows commands](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands/)
Ask Learn
Ask Learn
Focus mode
Table of contents
[Read in English](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy)
Add to Collections
Add to plan
[Edit](https://github.com/MicrosoftDocs/windowsserverdocs/blob/main/WindowsServerDocs/administration/windows-commands/copy.md)
***
#### Share via
[Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fwindows-server%2Fadministration%2Fwindows-commands%2Fcopy%3FWT.mc_id%3Dfacebook) [x.com](https://twitter.com/intent/tweet?original_referer=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fwindows-server%2Fadministration%2Fwindows-commands%2Fcopy%3FWT.mc_id%3Dtwitter&tw_p=tweetbutton&url=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fwindows-server%2Fadministration%2Fwindows-commands%2Fcopy%3FWT.mc_id%3Dtwitter) [LinkedIn](https://www.linkedin.com/feed/?shareActive=true&text=%0A%0D%0Ahttps%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fwindows-server%2Fadministration%2Fwindows-commands%2Fcopy%3FWT.mc_id%3Dlinkedin) [Email](mailto:?subject=%5BShared%20Article%5D%20copy%20%7C%20Microsoft%20Learn&body=%0A%0D%0Ahttps%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fwindows-server%2Fadministration%2Fwindows-commands%2Fcopy%3FWT.mc_id%3Demail)
***
Copy Markdown
Print
***
Note
Access to this page requires authorization. You can try [signing in](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy) or [changing directories]().
Access to this page requires authorization. You can try [changing directories]().
# copy
- Applies to: β
[Windows Server 2025](https://learn.microsoft.com/windows-server/get-started/windows-server-release-info), β
[Windows Server 2022](https://learn.microsoft.com/windows-server/get-started/windows-server-release-info), β
[Windows Server 2019](https://learn.microsoft.com/windows-server/get-started/windows-server-release-info), β
[Windows Server 2016](https://learn.microsoft.com/windows-server/get-started/windows-server-release-info), β
[Windows 11](https://learn.microsoft.com/windows/release-health/supported-versions-windows-client), β
[Windows 10](https://learn.microsoft.com/windows/release-health/supported-versions-windows-client), β
[Azure Local 2311.2 and later](https://learn.microsoft.com/azure/azure-local/release-information-23h2)
Feedback
Summarize this article for me
## In this article
1. [Syntax](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy#syntax)
2. [Examples](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy#examples)
3. [Related links](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy#related-links)
Copies one or more files from one location to another.
Note
You can also use the **copy** command, with different parameters, from the Recovery Console. For more information about the recovery console, see [Windows Recovery Environment (Windows RE)](https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-recovery-environment--windows-re--technical-reference).
## Syntax
Copy
```
copy [/d] [/v] [/n] [/y | /-y] [/z] [/a | /b] <source> [/a | /b] [+<source> [/a | /b] [+ ...]] [<destination> [/a | /b]]
```
### Parameters
Expand table
| Parameter | Description |
|---|---|
| /d | Allows the encrypted files being copied to be saved as decrypted files at the destination. |
| /v | Verifies that new files are written correctly. |
| /n | Uses a short file name, if available, when copying a file with a name longer than eight characters, or with a file name extension longer than three characters. |
| /y | Suppresses prompting to confirm that you want to overwrite an existing destination file. |
| /-y | Prompts you to confirm that you want to overwrite an existing destination file. |
| /z | Copies networked files in restartable mode. |
| /a | Indicates an ASCII text file. |
| /b | Indicates a binary file. |
| `<source>` | Required. Specifies the location from which you want to copy a file or set of files. *Source* can consist of a drive letter and colon, a directory name, a file name, or a combination of these. |
| `<destination>` | Required. Specifies the location to which you want to copy a file or set of files. *Destination* can consist of a drive letter and colon, a directory name, a file name, or a combination of these. |
| /? | Displays help at the command prompt. |
#### Remarks
- You can copy an ASCII text file that uses an end-of-file character (CTRL+Z) to indicate the end of the file.
- If **/a** precedes or follows a list of files on the command line, it applies to all files listed until **copy** encounters **/b**. In this case, **/b** applies to the file preceding **/b**.
The effect of **/a** depends on its position in the command-line string: - If **/a** follows *source*, the **copy** command treats the file as an ASCII file and copies data that precedes the first end-of-file character (CTRL+Z). - If **/a** follows *destination*, the **copy** command adds an end-of-file character (CTRL+Z) as the last character of the file.
- If **/b** directs the command interpreter to read the number of bytes specified by the file size in the directory. **/b** is the default value for **copy**, unless **copy** combines files.
- If **/b** precedes or follows a list of files on the command line, it applies to all listed files until **copy** encounters **/a**. In this case, **/a** applies to the file preceding **/a**.
The effect of **/b** depends on its position in the command-line string: - If **/b** follows *source*, the **copy** command copies the entire file, including any end-of-file character (CTRL+Z). - If **/b** follows *destination*, the **copy** command doesn't add an end-of-file character (CTRL+Z).
- If a write operation cannot be verified, an error message appears. Although recording errors rarely occur with the **copy** command , you can use **/v** to verify that critical data has been correctly recorded. The **/v** command-line option also slows down the **copy** command, because each sector recorded on the disk must be checked.
- If **/y** is preset in the **COPYCMD** environment variable, you can override this setting by using **/-y** at the command line. By default, you are prompted when you replace this setting, unless the **copy** command is executed in a batch script.
- To append files, specify a single file for *destination*, but multiple files for *source* (use wildcard characters or *file1*\+*file2*\+*file3* format).
- If the connection is lost during the copy phase (for example, if the server going offline breaks the connection), you can use **copy /z** to resume after the connection is re-established. The **/z** option also displays the percentage of the copy operation that is completed for each file.
- You can substitute a device name for one or more occurrences of *source* or *destination*.
- If *destination* is a device (for example, Com1 or Lpt1), the **/b** option copies data to the device in binary mode. In binary mode, **copy /b** copies all characters (including special characters such as CTRL+C, CTRL+S, CTRL+Z, and ENTER) to the device, as data. However, if you omit **/b**, the data is copied to the device in ASCII mode. In ASCII mode, special characters might cause files to combine during the copying process.
- If you don't specify a destination file, a copy is created with the same name, modified date, and modified time as the original file. The new copy is stored in the current directory on the current drive. If the source file is on the current drive and in the current directory and you do not specify a different drive or directory for the destination file, the **copy** command stops and displays the following error message:
Copy
```
File cannot be copied onto itself
0 File(s) copied
```
- If you specify more than one file in *source*, the **copy** command combines them all into a single file using the file name specified in *destination*. The **copy** command assumes the combined files are ASCII files unless you use the **/b** option.
- To copy files that are 0 bytes long, or to copy all of a directory's files and subdirectories, use the [xcopy command](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy).
- To assign the current time and date to a file without modifying the file, use the following syntax:
Copy
```
copy /b <source> +,,
```
Where the commas indicate that the *destination* parameter has been intentionally left out.
## Examples
To copy a file called *memo.doc* to *letter.doc* in the current drive and ensure that an end-of-file character (CTRL+Z) is at the end of the copied file, type:
Copy
```
copy memo.doc letter.doc /a
```
To copy a file named *robin.typ* from the current drive and directory to an existing directory named *Birds* that is located on drive C, type:
Copy
```
copy robin.typ c:\birds
```
Note
If the *Birds* directory doesn't exist, the file *robin.typ* is copied into a file named *Birds* that is located in the root directory on the disk in drive C.
To combine *Mar89.rpt*, *Apr89.rpt*, and *May89.rpt*, which are located in the current directory, and place them in a file named *Report* (also in the current directory), type:
Copy
```
copy mar89.rpt + apr89.rpt + may89.rpt Report
```
Note
If you combine files, the **copy** command marks the destination file with the current date and time. If you omit *destination*, the files are combined and stored under the name of the first file in the list.
To combine all files in *Report*, when a file named *Report* already exists, type:
Copy
```
copy report + mar89.rpt + apr89.rpt + may89.rpt
```
To combine all files in the current directory that have the .txt file name extension into a single file named *Combined.doc*, type:
Copy
```
copy *.txt Combined.doc
```
To combine several binary files into one file by using wildcard characters, include **/b**. This prevents Windows from treating CTRL+Z as an end-of-file character. For example, type:
Copy
```
copy /b *.exe Combined.exe
```
Caution
If you combine binary files, the resulting file might be unusable due to internal formatting.
- Combining each file that has a .txt extension with its corresponding .ref file creates a file with the same file name, but with a .doc extension. The **Copy** command combines *file1.txt* with *file1.ref* to form *file1.doc*, and then the command combines *file2.txt* with *file2.ref* to form *file2.doc*, and so on. For example, type:
Copy
```
copy *.txt + *.ref *.doc
```
To combine all files with the .txt extension, and then to combine all files with the .ref extension into one file named *Combined.doc*, type:
Copy
```
copy *.txt + *.ref Combined.doc
```
## Related links
- [Command-Line Syntax Key](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/command-line-syntax-key)
- [xcopy command](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy)
***
## Feedback
Was this page helpful?
Yes
No
No
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Ask Learn
Ask Learn
Suggest a fix?
***
## Additional resources
***
- Last updated on
02/03/2023
## In this article
1. [Syntax](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy#syntax)
2. [Examples](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy#examples)
3. [Related links](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy#related-links)
Was this page helpful?
Yes
No
No
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Ask Learn
Ask Learn
Suggest a fix?
## Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
[Sign in](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/copy)
[English (United States)](https://learn.microsoft.com/en-us/locale?target=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fwindows-server%2Fadministration%2Fwindows-commands%2Fcopy)
[Your Privacy Choices](https://aka.ms/yourcaliforniaprivacychoices)
Theme
- Light
- Dark
- High contrast
- [AI Disclaimer](https://learn.microsoft.com/en-us/principles-for-ai-generated-content)
- [Previous Versions](https://learn.microsoft.com/en-us/previous-versions/)
- [Blog](https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog)
- [Contribute](https://learn.microsoft.com/en-us/contribute)
- [Privacy](https://go.microsoft.com/fwlink/?LinkId=521839)
- [Consumer Health Privacy](https://go.microsoft.com/fwlink/?linkid=2259814)
- [Terms of Use](https://learn.microsoft.com/en-us/legal/termsofuse)
- [Trademarks](https://www.microsoft.com/legal/intellectualproperty/Trademarks/)
- Β© Microsoft 2026 |
| Readable Markdown | Copies one or more files from one location to another.
```
copy [/d] [/v] [/n] [/y | /-y] [/z] [/a | /b] <source> [/a | /b] [+<source> [/a | /b] [+ ...]] [<destination> [/a | /b]]
```
| Parameter | Description |
|---|---|
| /d | Allows the encrypted files being copied to be saved as decrypted files at the destination. |
| /v | Verifies that new files are written correctly. |
| /n | Uses a short file name, if available, when copying a file with a name longer than eight characters, or with a file name extension longer than three characters. |
| /y | Suppresses prompting to confirm that you want to overwrite an existing destination file. |
| /-y | Prompts you to confirm that you want to overwrite an existing destination file. |
| /z | Copies networked files in restartable mode. |
| /a | Indicates an ASCII text file. |
| /b | Indicates a binary file. |
| `<source>` | Required. Specifies the location from which you want to copy a file or set of files. *Source* can consist of a drive letter and colon, a directory name, a file name, or a combination of these. |
| `<destination>` | Required. Specifies the location to which you want to copy a file or set of files. *Destination* can consist of a drive letter and colon, a directory name, a file name, or a combination of these. |
| /? | Displays help at the command prompt. |
- You can copy an ASCII text file that uses an end-of-file character (CTRL+Z) to indicate the end of the file.
- If **/a** precedes or follows a list of files on the command line, it applies to all files listed until **copy** encounters **/b**. In this case, **/b** applies to the file preceding **/b**.
The effect of **/a** depends on its position in the command-line string: - If **/a** follows *source*, the **copy** command treats the file as an ASCII file and copies data that precedes the first end-of-file character (CTRL+Z). - If **/a** follows *destination*, the **copy** command adds an end-of-file character (CTRL+Z) as the last character of the file.
- If **/b** directs the command interpreter to read the number of bytes specified by the file size in the directory. **/b** is the default value for **copy**, unless **copy** combines files.
- If **/b** precedes or follows a list of files on the command line, it applies to all listed files until **copy** encounters **/a**. In this case, **/a** applies to the file preceding **/a**.
The effect of **/b** depends on its position in the command-line string: - If **/b** follows *source*, the **copy** command copies the entire file, including any end-of-file character (CTRL+Z). - If **/b** follows *destination*, the **copy** command doesn't add an end-of-file character (CTRL+Z).
- If a write operation cannot be verified, an error message appears. Although recording errors rarely occur with the **copy** command , you can use **/v** to verify that critical data has been correctly recorded. The **/v** command-line option also slows down the **copy** command, because each sector recorded on the disk must be checked.
- If **/y** is preset in the **COPYCMD** environment variable, you can override this setting by using **/-y** at the command line. By default, you are prompted when you replace this setting, unless the **copy** command is executed in a batch script.
- To append files, specify a single file for *destination*, but multiple files for *source* (use wildcard characters or *file1*\+*file2*\+*file3* format).
- If the connection is lost during the copy phase (for example, if the server going offline breaks the connection), you can use **copy /z** to resume after the connection is re-established. The **/z** option also displays the percentage of the copy operation that is completed for each file.
- You can substitute a device name for one or more occurrences of *source* or *destination*.
- If *destination* is a device (for example, Com1 or Lpt1), the **/b** option copies data to the device in binary mode. In binary mode, **copy /b** copies all characters (including special characters such as CTRL+C, CTRL+S, CTRL+Z, and ENTER) to the device, as data. However, if you omit **/b**, the data is copied to the device in ASCII mode. In ASCII mode, special characters might cause files to combine during the copying process.
- If you don't specify a destination file, a copy is created with the same name, modified date, and modified time as the original file. The new copy is stored in the current directory on the current drive. If the source file is on the current drive and in the current directory and you do not specify a different drive or directory for the destination file, the **copy** command stops and displays the following error message:
```
File cannot be copied onto itself
0 File(s) copied
```
- If you specify more than one file in *source*, the **copy** command combines them all into a single file using the file name specified in *destination*. The **copy** command assumes the combined files are ASCII files unless you use the **/b** option.
- To copy files that are 0 bytes long, or to copy all of a directory's files and subdirectories, use the [xcopy command](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy).
- To assign the current time and date to a file without modifying the file, use the following syntax:
```
copy /b <source> +,,
```
Where the commas indicate that the *destination* parameter has been intentionally left out.
To copy a file called *memo.doc* to *letter.doc* in the current drive and ensure that an end-of-file character (CTRL+Z) is at the end of the copied file, type:
```
copy memo.doc letter.doc /a
```
To copy a file named *robin.typ* from the current drive and directory to an existing directory named *Birds* that is located on drive C, type:
```
copy robin.typ c:\birds
```
Note
If the *Birds* directory doesn't exist, the file *robin.typ* is copied into a file named *Birds* that is located in the root directory on the disk in drive C.
To combine *Mar89.rpt*, *Apr89.rpt*, and *May89.rpt*, which are located in the current directory, and place them in a file named *Report* (also in the current directory), type:
```
copy mar89.rpt + apr89.rpt + may89.rpt Report
```
Note
If you combine files, the **copy** command marks the destination file with the current date and time. If you omit *destination*, the files are combined and stored under the name of the first file in the list.
To combine all files in *Report*, when a file named *Report* already exists, type:
```
copy report + mar89.rpt + apr89.rpt + may89.rpt
```
To combine all files in the current directory that have the .txt file name extension into a single file named *Combined.doc*, type:
```
copy *.txt Combined.doc
```
To combine several binary files into one file by using wildcard characters, include **/b**. This prevents Windows from treating CTRL+Z as an end-of-file character. For example, type:
```
copy /b *.exe Combined.exe
```
Caution
If you combine binary files, the resulting file might be unusable due to internal formatting.
- Combining each file that has a .txt extension with its corresponding .ref file creates a file with the same file name, but with a .doc extension. The **Copy** command combines *file1.txt* with *file1.ref* to form *file1.doc*, and then the command combines *file2.txt* with *file2.ref* to form *file2.doc*, and so on. For example, type:
```
copy *.txt + *.ref *.doc
```
To combine all files with the .txt extension, and then to combine all files with the .ref extension into one file named *Combined.doc*, type:
```
copy *.txt + *.ref Combined.doc
```
- [Command-Line Syntax Key](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/command-line-syntax-key)
- [xcopy command](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy) |
| Shard | 168 (laksa) |
| Root Hash | 14615152987638977768 |
| Unparsed URL | com,microsoft!learn,/en-us/windows-server/administration/windows-commands/copy s443 |