I have a backup folder that i should copy it weekly , so i use a batch file in the task sheduler of Windows contains this line
xcopy /s "C:\backupMai" "\\myserver\backup$\logFile\c022456"but when the next week come the script doesn't run and always show this message : Overwrite \myserver\backup$\logFile\c022456\MFU1.dat (Yes/No/All)?
I want to overwrite the whole contains of folder what i should be add to my code
1 Answer
If I want to overwrite the entire contents of the folder, what should I add to my code?
You may want to try adding the /Y option:
xcopy /s /y "C:\backupMai" "\\myserver\backup$\logFile\c022456"As noted in this SS64 page on XCOPY, the /Y option suppresses the prompt to confirm overwriting a file.