[windows] XCOPY: Overwrite all without prompt in BATCH

I create a batch program, which is copying all files newer than the destination from "C:\Users\ADMIN\Desktop" to "D:\Backup". This code is good:

xcopy "C:\Users\ADMIN\Desktop\*.*" "D:\Backup\" /K /D /H

But it asks every existing destination files: Overwrite file [Yes / No / All]?

I want to OVERWRITE all existing destination files WITHOUT user intervention.

How can I solve this?

Thanks for your answers!

This question is related to windows batch-file cmd xcopy

The answer is


The solution is the /Y switch:

xcopy "C:\Users\ADMIN\Desktop\*.*" "D:\Backup\" /K /D /H /Y

Examples related to windows

"Permission Denied" trying to run Python on Windows 10 A fatal error occurred while creating a TLS client credential. The internal error state is 10013 How to install OpenJDK 11 on Windows? I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? git clone: Authentication failed for <URL> How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning" XCOPY: Overwrite all without prompt in BATCH Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory how to open Jupyter notebook in chrome on windows Tensorflow import error: No module named 'tensorflow'

Examples related to batch-file

'ls' is not recognized as an internal or external command, operable program or batch file '' is not recognized as an internal or external command, operable program or batch file XCOPY: Overwrite all without prompt in BATCH CanĀ“t run .bat file under windows 10 Execute a batch file on a remote PC using a batch file on local PC Windows batch - concatenate multiple text files into one How do I create a shortcut via command-line in Windows? Getting Error:JRE_HOME variable is not defined correctly when trying to run startup.bat of Apache-Tomcat Curl not recognized as an internal or external command, operable program or batch file Best way to script remote SSH commands in Batch (Windows)

Examples related to cmd

'ls' is not recognized as an internal or external command, operable program or batch file '' is not recognized as an internal or external command, operable program or batch file XCOPY: Overwrite all without prompt in BATCH VSCode Change Default Terminal How to install pandas from pip on windows cmd? 'ls' in CMD on Windows is not recognized Command to run a .bat file VMware Workstation and Device/Credential Guard are not compatible How do I kill the process currently using a port on localhost in Windows? how to run python files in windows command prompt?

Examples related to xcopy

XCOPY: Overwrite all without prompt in BATCH How do I find files with a path length greater than 260 characters in Windows? Xcopy Command excluding files and folders batch to copy files with xcopy What is going wrong when Visual Studio tells me "xcopy exited with code 4" XCOPY switch to create specified directory if it doesn't exist? BATCH file asks for file or folder /exclude in xcopy just for a file type Copy files without overwrite xcopy file, rename, suppress "Does xxx specify a file name..." message