简体   繁体   中英

VisualStudion 2012: Post build Events

In my project I have got following post-build Event:

xcopy "$(TargetDir)Data" "$(ProjectDir)Data" /Y /I

After the run has ended the program copies the files. But if in TargetDir/Data is a complete NEW file, this event does not copy the new file to ProjectDir/Data.

but I would like to have this new files copied to TargetDir/Data. How do I achieve this?

Thanks for help!

"Data" sounds like a directory, not a file. You'll have to create it first. You also appear to have reversed the arguments. Fix:

  if not exist "$(TargetDir)Data" mkdir "$(TargetDir)Data".
  xcopy "$(ProjectDir)Data\*.*" "$(TargetDir)Data" /Y /I /D

If you in fact meant to copy back to the project directory, very unusual, then just swap TargetDir and ProjectDir in the above snippet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM