1

In Windows 10, i am trying to do copy, paste and overwrite without getting asked to re-enter anything manually, because its a batch automated task.

but whenever i execute the command it keep asking me to input manually F or D.

How can i by default tell the xcopy do not ask do overwrite + its not F its D?

windows10> xcopy C:\from_backup C:\to_destination /s /e /h /y

Does C:\to_destination specify a file name or directory name 
on the target
(F = file, D = directory)? 

Cursor is blinking in to type manually D or F and never automatically taking the default D input here.

aschipfl
  • 33,626
  • 12
  • 54
  • 99
  • XCopy was superseded by RoboCopy in Windows Vista, you've updated your OS, so try using the updated tools! That said you are supposed to specify a file or files as the source, you have specified a directory. Additionally there is an /i switch with XCopy which may be of use to you too. – Compo Sep 14 '16 at 15:45

2 Answers2

2

That is what the /I switch is for, it tells xcopy to assume the target to be a directory in case it does not yet exist:

xcopy /S /E /H /Y /I "C:\from_backup" "C:\to_destination"

This only works in case the source is not a single file, but that is not the case as you specified a source directory anyway.

Alternatively, terminate the target with a backslash, so it is treated as directory:

xcopy /S /E /H /Y "C:\from_backup" "C:\to_destination\"
aschipfl
  • 33,626
  • 12
  • 54
  • 99
1

Create the directory "C:\to_destination" first before the XCOPY (in the batch file) via:

MD "C:\to_destination"