welcome back to the adventure this is Adam and today we're taking a look at
the replace command in ms-dos the replace command functions a lot like
copy except it gives you more options for what you would like to copy there
are six switches in total for the replace command and we're going to go
over them one at a time first of all I would like to try the slash a switch it
stands for add let's try it
so for the command we type replace and any switches after that which in this
case I used slash a followed by the source which is our floppy drive I have
a floppy disk in there with some files on it and the destination directory
which is our data directory on the C Drive the replace command found one file
that did not exist in the destination directory so it copied the file over for
the next switch I would like to look at is slash u which means update so it's
looking at the date that the file was last modified if the date of the file on
our source which is our floppy disk in this case is newer than what's in the
data directory it will be copied over
in this case we had one file on the floppy disk that was newer so that was
copied over to our dative directory for us
next I would like to look at a combination of switches we're going to
use /s for sub-directory /w for weight and /p for prompt
so here's what happens when you type in the /w switch you are prompted to press
a key before the command will execute this is very useful if you need to
switch floppy disks before executing the command /p is going to require us to say
yes or no to every file before it makes any changes one thing that I find
peculiar is that I don't get any more information here than the name of the
file I personally think it would be beneficial to have maybe a last modified
date or something that would indicate if one file is newer than the other like we
get with modern Windows operating systems if you're copying over a file
that already exists it gives you a few details on the file so you can figure
out if you want to replace the file in the destination folder or not so in this
case I'm going to say no to the text documents here and it's just the letter
Y or the letter n you don't press ENTER afterwards
lastly we'll take a look at what happens if you just type in replace with no
switches
that does exactly what you would expect it replaces all of the files that have a
matching name between the source and the destination that concludes our look at
the replace command in ms-dos thanks for stopping by see you next video