I'm using XCOPY in a post-build event to copy some files to the bin directory. However, I don't want to overwrite when the file is already up to date. How can I do that?
sample:
echo F | xcopy /y "$(ProjectDir)..\Files\MyFile.ini" "$(TargetDir)"
Well, surely you do want to overwrite when the .ini file was changed. Use the /d option, xcopy will skip the copy if the target file is up to date.
- Hans Passant
Oh, thank you, it worked. Why you didn't post as answer?
- Pedro77
Because you asked the wrong question. Why you didn't edit it after that comment is a mystery to me.
- Hans Passant
1 Answers
0
votes
"Use the /d option, xcopy will skip the copy if the target file is up to date". Answer from comments.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
/doption, xcopy will skip the copy if the target file is up to date. - Hans Passant