Xcopy Command (Piv txwv, Options, Switches, thiab Ntau)

Cov txheej txheem:

Xcopy Command (Piv txwv, Options, Switches, thiab Ntau)
Xcopy Command (Piv txwv, Options, Switches, thiab Ntau)
Anonim

Cov lus txib xcopy yog Command Prompt hais kom siv los luam ib lossis ntau cov ntaub ntawv lossis folders ntawm ib qhov chaw mus rau lwm qhov chaw.

Nrog nws ntau txoj kev xaiv thiab muaj peev xwm luam tawm tag nrho cov npe, nws zoo ib yam li, tab sis muaj zog ntau dua, cov lus txib luam. Cov lus txib robocopy kuj zoo ib yam tab sis muaj ntau txoj kev xaiv.

Image
Image

Xcopy Command Availability

Cov lus txib no muaj nyob hauv qhov Command Prompt hauv txhua qhov Windows operating systems suav nrog Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows 98, thiab lwm yam.

Koj tuaj yeem nkag mus rau cov lus txib hauv MS-DOS raws li DOS hais kom ua.

Xcopy Command Syntax

Siv cov syntax hauv qab no rau xcopy hais kom ua:

xcopy source [destination] [ /a] [ /b] [ /c] [ /d [ : hnub] [ /e] [ /f] [ /g] [ /h] [ /i] [/j ] [/k ] [/l ] [ /m ] [/n ] [/o ] [/p ] [/q ] [/r ] [/s ] [/t ] [/u ] [/v ] [/w ] [ /x ] [/y ] [/-y ] [/z] [ /exclude: file1 [ + file2][ + file3]…] [ /?

Qhov muaj qee qhov xcopy hais kom hloov pauv thiab lwm yam kev hais kom ua syntax yuav txawv ntawm kev khiav hauj lwm rau kev khiav hauj lwm. Kawm paub yuav ua li cas nyeem cov lus txib yog tias koj tsis paub yuav ua li cas nyeem cov syntax saum toj no lossis hauv cov lus hauv qab no.

Xcopy Command Options
source Qhov no txhais cov ntaub ntawv lossis cov ntawv teev npe saum toj kawg nkaus uas koj xav luam tawm. Lub hauv paus yog qhov yuav tsum tau parameter nkaus xwb. Siv cov lus nyob ib ncig ntawm qhov chaw yog tias nws muaj qhov chaw.
destination qhov kev xaiv no qhia qhov chaw nyob qhov twg cov ntaub ntawv los yog cov folders yuav tsum tau theej rau. Yog tias tsis muaj lub hom phiaj tau teev tseg, cov ntaub ntawv lossis cov folders yuav raug theej rau tib lub nplaub tshev uas koj khiav cov lus txib xcopy los ntawm. Siv cov lus nyob ib ncig ntawm qhov chaw yog tias nws muaj qhov chaw.
Siv qhov kev xaiv no tsuas yog luam cov ntaub ntawv khaws cia pom hauv qhov chaw. Koj siv tsis tau /a thiab /m ua ke.
/b Siv qhov kev xaiv no los luam cov cim txuas nws tus kheej tsis yog lub hom phiaj txuas. Qhov kev xaiv no yog thawj zaug muaj nyob rau hauv Windows Vista.
/c Qhov kev xaiv no yuam xcopy mus txuas ntxiv txawm tias nws ntsib qhov yuam kev.
/d [ : hnub Siv cov lus txib nrog /d kev xaiv thiab hnub tshwj xeeb, hauv hom MM-DD-YYYY, luam cov ntaub ntawv hloov pauv rau lossis tom qab hnub ntawd. Koj tuaj yeem siv qhov kev xaiv no yam tsis tau qhia txog hnub tshwj xeeb los luam cov ntaub ntawv hauv qhov chaw uas tshiab dua li cov ntaub ntawv qub uas twb muaj nyob rau hauv lo lus uas peb. Qhov no yuav pab tau thaum siv xcopy los ua cov ntaub ntawv thaub qab tsis tu ncua.
/e Thaum siv ib leeg lossis nrog /s, qhov kev xaiv no zoo ib yam li /s tab sis tseem yuav tsim cov ntawv khoob hauv qhov chaw uas kuj tau khoob hauv qhov chaw. Qhov /e kev xaiv kuj tuaj yeem siv ua ke nrog /t kev xaiv kom suav nrog cov npe khoob thiab cov npe subdirectories pom nyob rau hauv qhov chaw hauv cov qauv directory tsim nyob rau hauv lo lus uas peb.
/f qhov kev xaiv no yuav tso saib tag nrho txoj hauv kev thiab cov ntaub ntawv npe ntawm ob lub hauv paus thiab cov ntaub ntawv lo lus uas tau theej.
/g Siv xcopy nrog qhov kev xaiv no tso cai rau koj luam cov ntaub ntawv encrypted hauv qhov chaw mus rau qhov chaw uas tsis txhawb nqa encryption. Qhov kev xaiv no yuav tsis ua haujlwm thaum luam cov ntaub ntawv los ntawm EFS encrypted tsav mus rau qhov tsis-EFS encrypted drive.
/h Cov lus txib tsis luam cov ntaub ntawv zais lossis cov ntaub ntawv kaw lus los ntawm lub neej ntawd tab sis yuav thaum siv qhov kev xaiv no.
/i Siv qhov /i kev xaiv los yuam xcopy los xav tias qhov chaw ntawd yog daim ntawv teev npe. Yog tias koj tsis siv qhov kev xaiv no, thiab koj tab tom luam tawm los ntawm qhov chaw uas yog cov npe lossis pab pawg ntawm cov ntaub ntawv thiab luam mus rau qhov chaw uas tsis muaj nyob, cov lus txib xcopy yuav ua rau koj nkag mus seb qhov chaw yog cov ntaub ntawv lossis cov npe.
/j qhov kev xaiv no luam cov ntaub ntawv yam tsis muaj buffering, qhov tshwj xeeb muaj txiaj ntsig rau cov ntaub ntawv loj heev. Qhov kev xaiv no yog thawj zaug muaj nyob rau hauv Windows 7.
/k Siv qhov kev xaiv no thaum luam cov ntaub ntawv nyeem nkaus xwb kom khaws cov ntaub ntawv tus cwj pwm nyob rau hauv lo lus uas peb.
/l Siv qhov kev xaiv no los qhia cov npe ntawm cov ntaub ntawv thiab cov folders yuav tsum tau theej… tab sis tsis muaj kev luam tawm tiag tiag. Qhov kev xaiv /l yog qhov muaj txiaj ntsig yog tias koj tab tom tsim cov lus txib nyuaj nrog ntau txoj kev xaiv thiab koj xav pom seb nws yuav ua haujlwm li cas.
/m qhov kev xaiv no zoo ib yam rau /a kev xaiv tab sis xcopy yuav tua tus cwj pwm archive tom qab luam cov ntaub ntawv. Koj siv tsis tau /m thiab /a ua ke.
qhov kev xaiv no tsim cov ntaub ntawv thiab cov folders hauv lo lus uas siv cov npe luv luv. Qhov kev xaiv no tsuas yog muaj txiaj ntsig thaum koj siv cov lus txib kom luam cov ntaub ntawv mus rau qhov chaw uas muaj nyob rau ntawm tus tsav formatted rau cov ntaub ntawv qub xws li FAT uas tsis txhawb cov npe ntev.
/o Khaws cov tswv cuab thiab Cov Ntawv Tswj Xyuas Kev Nkag Mus (ACL) cov ntaub ntawv hauv cov ntaub ntawv sau rau hauv lo lus uas peb.
Thaum siv qhov kev xaiv no, koj yuav raug ceeb toom ua ntej kev tsim ntawm txhua cov ntaub ntawv nyob rau hauv lo lus uas peb.
/q Ib yam kev tawm tsam ntawm /f kev xaiv, /q hloov yuav muab xcopy rau hauv hom " ntsiag to", hla mus rau -screen zaub ntawm txhua cov ntaub ntawv raug theej.
/r Siv qhov kev xaiv no los sau cov ntaub ntawv nyeem nkaus xwb hauv qhov chaw. Yog tias koj tsis siv qhov kev xaiv no thaum koj xav sau cov ntawv nyeem nkaus xwb nyob rau hauv lo lus uas peb, koj yuav raug ceeb toom nrog cov lus "Access denied" thiab cov lus txib yuav tsum tsis ua haujlwm.
/s Siv qhov kev xaiv no los luam cov npe, subdirectories, thiab cov ntaub ntawv muaj nyob hauv lawv, ntxiv rau cov ntaub ntawv hauv lub hauv paus ntawm qhov chaw. Cov ntaub ntawv khoob yuav tsis rov tsim dua.
/t qhov kev xaiv no yuam kom xcopy cov lus txib los tsim cov qauv qhia hauv qhov chaw tab sis tsis txhob luam cov ntaub ntawv. Hauv lwm lo lus, cov folders thiab subfolders pom hauv qhov chaw yuav raug tsim tab sis peb tsis muaj cov ntaub ntawv. Cov ntaub ntawv khoob yuav tsis raug tsim.
/u qhov kev xaiv no tsuas yog luam cov ntaub ntawv hauv qhov chaw uas twb nyob hauv qhov chaw.
/v qhov kev xaiv no txheeb xyuas txhua cov ntaub ntawv raws li nws tau sau, raws li nws qhov loj me, kom paub tseeb tias lawv zoo ib yam. Kev pov thawj tau tsim nyob rau hauv cov lus txib pib hauv Windows XP, yog li qhov kev xaiv no tsis muaj dab tsi nyob rau tom qab versions ntawm Windows thiab tsuas yog suav nrog rau kev sib raug zoo nrog cov laus MS-DOS cov ntaub ntawv.
/w Siv qhov /w kev xaiv los nthuav qhia "Nias ib qho yuam sij thaum npaj txhij yuav luam cov ntaub ntawv" cov lus. Qhov kev hais kom ua yuav pib luam cov ntaub ntawv raws li tau qhia tom qab koj paub meej nrog lub xov tooj tseem ceeb. Qhov kev xaiv no tsis zoo ib yam li /p kev xaiv uas nug kom muaj pov thawj ua ntej txhua daim ntawv luam.
/x Qhov kev xaiv no luam cov ntaub ntawv tshawb xyuas thiab Cov Ntaub Ntawv Tswj Kev Nkag Mus Nkag (SACL) cov ntaub ntawv. Koj txhais tau /o thaum koj siv qhov /x kev xaiv.
/y Siv qhov kev xaiv no los txwv cov lus txib los ntawm kev qhia koj txog kev sau cov ntaub ntawv los ntawm qhov chaw uas twb muaj nyob rau hauv lo lus uas peb.
/-y Siv qhov kev xaiv no los yuam cov lus txib kom qhia koj txog kev sau cov ntaub ntawv. Qhov no yuav zoo li ib qho kev xaiv coj txawv txawv vim qhov no yog tus cwj pwm tsis zoo ntawm xcopy tab sis qhov kev xaiv / yyuav raug preset hauv COPYCMD ib puag ncig sib txawv ntawm qee lub khoos phis tawj, ua qhov kev xaiv no tsim nyog.
/z qhov kev xaiv no tso cai rau xcopy cov lus txib kom tsis txhob luam cov ntaub ntawv thaum lub network kev twb kev txuas ploj lawm thiab tom qab ntawd rov pib luam tawm ntawm qhov chaw uas nws tawm mus thaum qhov kev sib txuas tau rov tsim dua. Qhov kev xaiv no kuj qhia txog qhov feem pua coj rau txhua cov ntaub ntawv thaum lub sijhawm luam tawm.
/exclude: file1 [ + file2][ + file3]… qhov kev xaiv no tso cai rau koj los qhia ib lossis ntau lub npe uas muaj cov npe ntawm cov kab tshawb nrhiav uas koj xav kom cov lus txib siv los txiav txim siab cov ntaub ntawv thiab / lossis cov folders hla thaum luam.
/? Siv cov kev pab hloov nrog xcopy los qhia cov ncauj lus kom ntxaws txog cov lus txib. Executing xcopy /? yog tib yam li siv cov lus txib pab kom ua tiav pab xcopy.

Cov lus txib xcopy yuav ntxiv tus cwj pwm archive rau cov ntaub ntawv hauv lo lus uas tsis muaj teeb meem yog tias tus cwj pwm tau qhib lossis tawm ntawm cov ntaub ntawv hauv qhov chaw.

Xcopy Command Piv txwv

Ua raws li yog ob peb yam piv txwv ntawm kev siv cov lus txib no:

Copy Files to a New Folder


xcopy C:\Files E:\Files /i

Hauv qhov piv txwv saum toj no, cov ntaub ntawv muaj nyob hauv cov npe ntawm C:\ Cov ntaub ntawv raug theej mus rau qhov chaw, cov npe tshiab ntawm E tsav hu ua Cov Ntaub Ntawv.

Tsis muaj subdirectories, los yog tej ntaub ntawv uas muaj nyob rau hauv lawv, yuav muab theej vim qhov kev xaiv /s tsis siv.

Xcopy Backup Script


xcopy "C:\Important Files" D:\Backup /c /d /e /h /i /k /q /r /s /x /y

Hauv qhov piv txwv no, xcopy yog tsim los ua haujlwm raws li kev daws teeb meem. Sim qhov no yog tias koj xav siv xcopy es tsis txhob siv cov software thaub qab los thaub qab koj cov ntaub ntawv. Muab cov lus txib raws li qhia saum toj no hauv ib tsab ntawv thiab teem caij ua haujlwm hmo ntuj.

Raws li qhia saum toj no, cov lus txib yog siv los luam tag nrho cov ntaub ntawv thiab cov folders [/s] tshiab dua li cov uas twb tau theej lawm [/d], suav nrog cov ntawv khoob [/e] thiab cov ntaub ntawv zais [/h], los ntawm qhov chaw ntawm C: / Cov ntaub ntawv tseem ceeb rau qhov chaw ntawm D: / Thaub qab, uas yog cov npe . Peb muaj qee cov ntaub ntawv nyeem nkaus xwb peb xav kom hloov kho tshiab hauv qhov chaw [/r] thiab peb xav khaws cov cwj pwm ntawd tom qab tau theej [/k]. Peb kuj xav kom peb tswj hwm cov tswv cuab thiab tshawb xyuas cov chaw hauv cov ntaub ntawv uas peb tau theej [/x]. Thaum kawg, txij li thaum peb tab tom khiav xcopy hauv tsab ntawv, peb tsis tas yuav pom cov ntaub ntawv hais txog cov ntaub ntawv raws li lawv tau theej [/q], Peb tsis xav kom raug ceeb toom kom overwrite txhua tus [/y], thiab peb tsis xav kom cov lus txib nres yog tias nws khiav mus rau qhov yuam kev [/c].

Luam cov ntaub ntawv thiab cov folders hla lub Network


xcopy C:\Videos "\\SERVER\Media Backup" /f /j /s /w /z

Ntawm no, cov lus txib yog siv los luam tag nrho cov ntaub ntawv, subfolders, thiab cov ntaub ntawv muaj nyob rau hauv subfolders [/s] los ntawm qhov chaw ntawm C:\Videos mus rau lo lus zais nplaub tshev Media Backup nyob rau hauv lub computer ntawm lub network los ntawm lub npe SERVER. Peb tab tom luam qee cov ntaub ntawv video loj tiag tiag, yog li buffering yuav tsum tsis ua haujlwm txhawm rau txhim kho cov txheej txheem luam [/j], thiab txij li thaum peb luam tawm hauv lub network, peb xav rov pib luam dua yog tias peb poob kev sib txuas hauv network [/z]. Ua tsis txaus ntseeg, peb xav kom tau txais kev tshoov siab kom pib cov txheej txheem ua ntej nws ua dab tsi [/w], thiab peb kuj xav pom txhua yam txog cov ntaub ntawv twg raug theej thaum lawv tau theej [/f].

Dubplicate Folder Structure


xcopy C:\Client032 C:\Client033 /t /e

Hauv qhov piv txwv zaum kawg no, peb muaj cov ntaub ntawv muaj txiaj ntsig zoo thiab cov folders hauv C:\Client032 rau tus neeg siv khoom. Peb twb tau tsim ib qho chaw khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khi Peb muaj qee qhov khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob khoob

Txuag lub sijhawm ntev tso tawm ntawm xcopy hais kom ua rau cov ntaub ntawv siv tus neeg teb xov tooj rov qab. Kawm paub yuav ua li cas hloov cov lus txib tso tawm rau cov ntaub ntawv lossis tshawb xyuas Command Prompt Tricks rau cov lus qhia ntxiv.

Xcopy & Xcopy32

Hauv Windows 98 thiab Windows 95, ob lub qauv ntawm xcopy hais kom ua muaj: xcopy thiab xcopy32. Txawm li cas los xij, cov lus txib tom kawg tsis tau npaj los khiav ncaj qha.

Thaum koj ua xcopy hauv Windows 95 lossis 98, txawm tias tus thawj 16-ntsis version tau txiav txim siab ua tiav (thaum nyob rau hauv MS-DOS hom) lossis 32-ntsis version tshiab yuav raug tua (thaum hauv Windows).

Kom meej meej, tsis hais qhov version ntawm Windows lossis MS-DOS koj muaj, ib txwm khiav cov lus txib xcopy, tsis yog xcopy32, txawm tias nws muaj. Thaum koj ua xcopy, koj ib txwm khiav qhov tsim nyog tshaj plaws ntawm cov lus txib.

Xcopy Related Commands

Cov lus txib xcopy zoo ib yam li ntau txoj hauv kev rau cov ntawv luam tab sis muaj ntau txoj kev xaiv, xws li muaj peev xwm luam cov folders, luam txhua cov ntaub ntawv hauv subdirectories, thiab cais cov ntaub ntawv.

Cov lus txib no kuj zoo ib yam li cov lus txib robocopy tshwj tsis yog tias robocopy muaj kev hloov pauv ntau dua li xcopy.

Cov lus txib dir feem ntau siv nrog xcopy los xyuas cov folders thiab cov ntaub ntawv twg nyob rau hauv cov npe ua ntej ua tiav cov lus txib.

Pom zoo: