ļļ0
08-04-12 17:23  ڣϾɼˡࣺδ
xcopyʵ,磺

C:\>xcopy C:\ppt\*.* D:\ppt\ /s /e

˼ǰCµPPTļȫD

XCOPY ڶĹܣ ǼӲɵġ/s /e ÷ֱǰĿ¼ͿĿ¼ƹȥһЩʹþͲ˵£ 
1ֻǵظ E:\ ļ D:\ ϣ롰 xcopy e:\*.* d: /s /h "ڸƹУ㲻ҪļǾͰȼCtrl " +"Pause /break" ȼ жϸơ 
2E:\ ļƵD:\ϣΪ츴һ㣬ٽŸһЩٽŸһЩĳԭϴûиɣŸơǾڸļгֵģǿôźأ 
Ǿ롰 xcopy e:\*.* d: /s /h /d /y ܲЩļѾƹȥЩļûиƹȥġ 
3ȻҲһЩļѾ޸Ĺ°汾ԭݵǷļҪʱôͬأȻǿ԰µĺ÷ļƹȥҲһֽ취 
޸ĵļкܶģԼʱҲǲǷļǸ¹ġôԭݵǷļҪ£ҪƹȥɲǼʡĻ׳һЩļ 
ǺһҲͬ" xcopy e:\*.* d: /s /h /d /y " 
4һǾҲģΪĳļļʹУֹͣ˸ƹ磬C ϵ windows xp ʱĳļĳʹļļ 
ڶһ" /c " " xcopy e:\*.* d: /s /h /d /c /y " 
5ʱXCOPY ΪԶƣҸɺرյԣԽһļ½ıĵΪXCOPY.BAT ȻչԭTXT ʽҪΪBAT  XCOPY.BAT  
xcopy e:\*.* d: /s /h /c /y 
shutdown -s 
Ȼ˫xcopy.bat ʱԳȥԻԼƱļȻԶرյԡ 

XCOPY source [destination] ( /s /e) 
source ָҪƵļ 
destination ָļλú/ơ 
/A ֻд浵ռļ 
ıա 
/M ֻд浵ռļ 
رմ浵ա 
/D:m-d-y ָڻָԺıļ 
ûṩڣֻЩԴʱ 
Ŀʱµļ 
/EXCLUDE:file1[+file2][+file3]... 
ַָļбκ 
ַҪƵļľ· 
Ǹļõơ 
磬ָ \obj\  .obj ַų 
Ŀ¼ obj ļ 
.obj չļ 
/P ÿĿļǰʾ 
/S Ŀ¼Ŀ¼˿յġ 
/E Ŀ¼Ŀ¼յġ 
 /S /E ͬ޸ /T 
/V ֤ÿļ 
/W ʾڸǰ 
/C ʹдҲơ 
/I Ŀ겻ڣڸһϵļ 
ٶĿһһĿ¼ 
/Q ʱʾļ 
/F ʱʾԴĿļ 
/L ʾҪƵļ 
/G ûоܵļƵ 
ּ֧ܵĿꡣ 
/H Ҳغϵͳļ 
/R дֻļ 
/T Ŀ¼ṹļ 
Ŀ¼Ŀ¼/T /E  
Ŀ¼Ŀ¼ 
/U ֻѾĿеļ 
/K աһ Xcopy ֻա 
/N ɵĶơ 
/O ļȨ ACL Ϣ 
/X ļ( /O) 
/Y ֹʾȷϸдһ 
ִĿļ 
/-Y ʾȷϸдһ 
ִĿļ 
/Z ģʽļ


Xcopy
ļĿ¼Ŀ¼

﷨
xcopy Source [Destination] [/w] [/p] [/c] [/v] [/q] [/f] [/l] [/g] [/d[:mm-dd-yyyy]] [/s [/e]] [/t] [/k] [/r] [/h] [{/a|/m}] [/n] [/o] [/x] [/exclude:file1[+[file2]][+[file3]] [{/y|/-y}] [/z]


Source 
ġָҪƵļλúơò· 
Destination 
ָҪƵļĿꡣò԰̷ðšĿ¼ļǵϡ 
/w 
ڿʼļ֮ǰʾϢȴӦ 
Press any key to begin copying file(s) 

/p 
ʾȷǷҪÿĿļ 
/c 
Դ 
/v 
дĿļʱ֤ÿļȷĿļԴļȫͬ 
/q 
ֹʾ xcopy Ϣ 
/f 
ʱʾԴļĿļ 
/l 
ʾҪƵļб 
/g 
ܵĿļ 
/d[:mm-dd-yyyy] 
ֻЩָڻָ֮ĹԴļ mm-dd-yyyy ֵxcopy ḴƱ Destination ļµ Source ļѡʹԸ¸Ĺļ 
/u 
ֻ source  destination еļ 
/i 
 Source һĿ¼ͨ Destination ڣxcopy ٶ destination ָĿ¼һĿ¼Ȼxcopy ὫָļƵĿ¼СĬ£xcopy ʾָ destination ļĿ¼ 
/s 
ƷǿյĿ¼Ŀ¼ʡ /sxcopy һĿ¼й 
/e 
Ŀ¼Ŀ¼ͬʱʹ /e/s  /t ѡ 
/t 
ֻĿ¼ṹĿ¼ļҪƿĿ¼ /e ѡ 
/k 
ļԴļֻգĿļбաĬ£xcopy ɾֻա 
/r 
ֻļ 
/h 
ƾغϵͳļյļĬ£xcopy ػϵͳļ 
/a 
ֻЩд浵ļõԴļ/a ޸ԴļĴ浵ļաйͨʹ attrib ô浵ļյϢġ 
/m 
ƾд浵ļõԴļ /a ͬ/m رԴָļĴ浵ļաйͨʹ attrib ô浵ļյϢġ 
/n 
ʹ NTFS ļĿ¼ļĿ¼ NTFS Ƶ FAT ߵĿļϵͳҪ FAT ļϵͳԼ 8.3 ַʱҪ /nĿļϵͳ FAT  NTFS 
/o 
ļȨѡķʿб (DACL) Ϣ 
/x 
ļúϵͳʿб (SACL) Ϣ /o 
/exclude:filename1[+[filename2]][+[filename3]] 
ַָļб 
/y 
ֹʾȷҪִĿļ 
/-y 
ʾȷҪĿļ 
/z 
ڿģʽͨ縴ơ 
/? 
ʾʾ 
ע
ʹ /v 
XOX

ʹ /exclude 
гÿļĵеÿַгκַҪƵļľ·κβƥ䣬ʹӸƽųļ磬ַָ "\Obj\"ų Obj Ŀ¼µļַָ ".obj"ų .obj չļ

ʹ /z 
ڸƹжʧӣ磬ӵķѻƹ̽½Ӻָ/z ҲʾÿļɵĸƲİٷֱȡ

 COPYCMD ʹ /y 
 COPYCMD ʹ /yʹ /-y ԸǸĬ£ʾǣű copy

Ƽܵļ 
ļƵ֧ EFS ľᵼ´ӦȽļļƵ֧ EFS ľС

ļ 
ҪļָĿļԴļʹͨļ 1 + ļ 2 + ļ 3 ʽ

Destination Ĭֵ 
ʡ Destinationxcopy ļƵǰĿ¼

ָ Destination ļĿ¼ 
 Destination Ŀ¼ҲԷб (\) βϢ 

Does destination specify a file name 
or directory name on the target 
(F = file, D = directory)? 

ҪһļƵһļ밴 FҪһļƵһĿ¼밴 D

ʹ /i ѡʾϢӶ xcopy ϶ԴǶļһĿ¼£ĿһĿ¼

ʹ xcopy  Destination ļĴ浵 
xcopy д浵õļԴļǷ趨˴աйļպ attrib ϸϢġ

Ƚ xcopy  diskcopy 
̵Ŀ¼аļҪ临ƵвͬʽĴУʹ xcopy Ҫʹ diskcopyΪ diskcopy һŵһŵظƴ̣ҪԴ̺Ŀ̵ĸʽͬxcopy ûиҪͨʹ xcopyҪĴͼ񸱱

xcopy ˳ 
Ҫ xcopy ص˳룬 if ʹ errorlevel йʹáif˳ķġ±гÿһ˳˵

˳ ˵ 
0 ļûд 
1 ûҵҪƵļ 
2 û CTRL+C ֹ xcopy 
4 ˳ʼû㹻ڴ̿ռ䣬Чƻ﷨ 
5 ˴д 


Ҫ A ļĿ¼пյĿ¼Ƶ B룺 

xcopy a:b:/s /e 

Ҫһʾеκϵͳļ밴ʾ /h ѡ

xcopy a:b:/s /e /h

Ҫʹ \Rawdata Ŀ¼ 1993  12  29 պĵļ \Reports Ŀ¼еļ룺 

xcopy \rawdata \reports /d:12-29-1993 

Ҫ \Reports дڵļڣ룺

xcopy \rawdata \reports /u

ֻǰһҪƵļбļ룺

xcopy \rawdata \reports /d:12-29-1993 /l > xcopy.out

ļ Xcopy.out гҪƵļ

Ҫ \Customer Ŀ¼Ŀ¼Ƶ H: ϵĿ¼ \\Public\Addressֻգ H: ϴļʱʾ룺

xcopy \customer h:\public\address /s /e /k /p

Ҫһȷ \Address Ŀ¼ʱ xcopy ᴴĿ¼ͬʱӦʾĿ¼ʱҪʾϢ밴ʾ /i ѡ

xcopy \customer h:\public\address /s /e /k /p /i

Դִ xcopy ʹ if ڷʱ˳롣磬µʹÿ滻 xcopy ԴĿ 

@echo off 
rem COPYIT.BAT transfers all files in all subdirectories of
rem the source drive or directory (%1) to the destination 

rem drive or directory (%2) 

xcopy %1 %2 /s /e 

if errorlevel 4 goto lowmemory 
if errorlevel 2 goto abort 
if errorlevel 0 goto exit 

:lowmemory 
echo Insufficient memory to copy files or 
echo invalid drive or command-line syntax. 
goto exit 

:abort 
echo You pressed CTRL+C to end the copy operation. 
goto exit 

:exit 

Ҫʹø C:\Prgmcode Ŀ¼Ŀ¼еļƵ B У룺 

copyit c:\prgmcode b: 

ͳ C:\Prgmcode 滻 %1  B: %2Ȼʹ xcopy  /e  /s ѡ xcopy 򽫶ȡ˳벢תӦ IF ERRORLEVEL ָʾıǩȻʾӦϢ˳