Megosztás a következőn keresztül:


cserél

Cserélje le a címtárban lévő meglévő fájlokat. If used with the /a option, this command adds new files to a directory instead of replacing existing files.

Syntax

replace [<drive1>:][<path1>]<filename> [<drive2>:][<path2>] [/a] [/p] [/r] [/w]
replace [<drive1>:][<path1>]<filename> [<drive2>:][<path2>] [/p] [/r] [/s] [/w] [/u]

Parameters

Parameter Description
[<drive1>:][<path1>]<filename> Megadja a forrásfájl vagy fájlkészlet helyét és nevét. The filename option is required, and can include wildcard characters (* and ?).
[<drive2>:][<path2>] Megadja a célfájl helyét. Nem adhat meg fájlnevet a lecserélt fájlokhoz. Ha nem ad meg meghajtót vagy elérési utat, ez a parancs az aktuális meghajtót és könyvtárat használja célként.
/a Új fájlokat ad hozzá a célkönyvtárhoz a meglévő fájlok cseréje helyett. You can't use this command-line option with the /s or /u command-line option.
/p Megerősítést kér a célfájl cseréje vagy a forrásfájl hozzáadása előtt.
/r Az írásvédett és a nem védett fájlokat cseréli le. If you attempt to replace a Read-only file, but you don't specify /r, an error results and stops the replacement operation.
/w Megvárja, amíg beszúr egy lemezt a forrásfájlok keresése előtt. If you don't specify /w, this command begins replacing or adding files immediately after you press ENTER.
/s Megkeresi a célkönyvtár összes alkönyvtárát, és lecseréli az egyező fájlokat. You can't use /s with the /a command-line option. The command doesn't search subdirectories that are specified in Path1.
/u Csak azokat a fájlokat cseréli le a célkönyvtárban, amelyek régebbiek, mint a forráskönyvtárban. You can't use /u with the /a command-line option.
/? Súgó megjelenítése a parancssorban.

Remarks

  • Mivel ez a parancs fájlokat ad hozzá vagy cserél le, a fájlnevek megjelennek a képernyőn. A parancs végrehajtása után egy összegző sor jelenik meg az alábbi formátumok egyikében:

    nnn files added
    nnn files replaced
    no file added
    no file replaced
    
  • If you're using floppy disks and you need to switch disks while running this command, you can specify the /w command-line option so that this command waits for you to switch the disks.

  • Ez a parancs nem használható rejtett fájlok vagy rendszerfájlok frissítésére.

  • Az alábbi táblázat az egyes kilépési kódokat és a jelentés rövid leírását mutatja be:

    Exit code Description
    0 Ez a parancs sikeresen lecserélte vagy hozzáadta a fájlokat.
    1 Ez a parancs az MS-DOS helytelen verzióját észlelte.
    2 Ez a parancs nem találja a forrásfájlokat.
    3 Ez a parancs nem találja a forrás vagy a cél elérési útját.
    5 A felhasználó nem rendelkezik hozzáféréssel a lecserélni kívánt fájlokhoz.
    8 Nincs elegendő rendszermemória a parancs végrehajtásához.
    11 A felhasználó helytelen szintaxist használt a parancssorban.

Note

You can use the ERRORLEVEL parameter on the if command line in a batch program to process exit codes that are returned by this command.

Examples

To update all the versions of a file named Phones.cli (which appear in multiple directories on drive C:), with the latest version of the Phones.cli file from a floppy disk in drive A:, type:

replace a:\phones.cli c:\ /s