0
votes

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)"
1
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.