Xcopy



ļĿ¼Ŀ¼


﷨



xcopy Source [Destination] [/w] [/p] [/c] [/v] [/q] [/f] [/l] [/g] [/d[:mm-dd-yyyy]] [/u] [/i] [/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 ָʾıǩȻʾӦϢ˳

XOX






