Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there any way to force copy? copy without overwrite prompt, using windows?

I want to write a list of windows commands(it's a long list) where it does all these magical things for me, but whenever I use copy, it stops to ask fro overwrite prompt. When I type yes, it overwrites the old file then just stops there.

How do I make it such that whenever the windows sees the copy command, it just overwrites the old file without that prompt?

like image 392
iCodeLikeImDrunk Avatar asked Jun 29 '12 15:06

iCodeLikeImDrunk


People also ask

How can I copy files without overwriting in Windows?

If you are copying files using drag-drop or copy/paste, you may simply choose “Skip this file” or “Skip these files” option to not overwrite the files that are already existed at the destination folder.

How do you copy and not replace?

All you have to do is hold down the Shift key while you click on no. It has the same effect as saying No To All which means that the copy process from that moment on will automatically select no if a duplicate file is found in the destination directory.

Does xcopy overwrite?

By default, you are prompted to overwrite, unless you run xcopy from within a batch script. The last part after second comma is not true for command XCOPY. This part is only true for command COPY. The option /Y must be specified for XCOPY to prevent the overwrite prompt even on usage of XCOPY from within a batch file.


2 Answers

You're looking for the /Y switch.

like image 107
SLaks Avatar answered Sep 28 '22 05:09

SLaks


MOVE /-Y Source Destination

Note:/-y will make the announcement of yes/no for overwrite

like image 33
Bashar Jebry Avatar answered Sep 28 '22 05:09

Bashar Jebry