133k views
2 votes
You need to copy several hundred files from one directory to another. Most of the files exist in the target directory, but you want to overwrite the existing files with the ones you will copy. You want the file copy to proceed automatically without prompting you to overwrite existing files. Which copy command switch should you use?

User Crops
by
5.1k points

1 Answer

5 votes

/y is the copy command which would replace the existing file without prompting the user again and again.

Step-by-step explanation:

"/y" is used in command line to copy files from one directory to another. Since there is a possibility of a file name already in existence, the windows would prompt before replacing. It is not possible to respond to the prompt every time if there are batches of files to be copied. So in those case "/y" command come to help us.

You must know the difference between "/Y" and "-/Y"

/Y "Suppresses prompting"

/-Y "Causes prompting"

Example:

c\> copy /-Y c:\dir1\\file1.txt c:\dir2\file2.txt

User TheJacobTaylor
by
5.4k points