mat-mcloughlin
mat-mcloughlin

Reputation: 6722

Post-build event not executing

I've written a post build script for my visual studio project

copy "$(TargetDir)ReportTemplates\*.*" "$(TargetDir)Excel\"
del /q "$(TargetDir)ReportTemplates"

and in the build output I get

  V:\project\ReportTemplates\CRC150.xls
  V:\project\ReportTemplates\SR558.xls
  V:\project\ReportTemplates\SR559.xls
          3 file(s) copied.
  Deleted file - V:\project\ReportTemplates\CRC150.xls
  Deleted file - V:\project\ReportTemplates\SR558.xls
  Deleted file - V:\project\ReportTemplates\SR559.xls

However when I got take a look in the directory the files have copied, but they are still there in the original location.

Anyone seen this before?

Upvotes: 1

Views: 1886

Answers (1)

Ivan Milosavljevic
Ivan Milosavljevic

Reputation: 839

Maybe this files are readonly, try adding /f - force in post build script. Also check if this files are not opened by your application or excel reader because this could be reason why you cant delete them.

Upvotes: 2

Related Questions