0

I am wanting to call a command file in visual studio 2013 in a post build event to keep things a little cleaner and more manageable...

the postbuild file lives in the project directory and is getting called.... however because i am using a relative path its not working for me

the project path is

c:\projects\solutionname\product\projectroot\postbuild.cmd and is looking to copy data from other built solutions in the same kind of structure

xcopy /y "..\projectrootofotherproject\bin\Debug\mydll.dll" ".\bin\Debug"

however this keeps on coming up with exited with code 4.

When i run this outside of visual studio it works fine, if i run it when in a powershell or command prompt window when its not in the project \ cmd file dir it complains... because it cant find the file which i believe is down to the relative path.

any help is much appreciated

Simon Price
  • 455
  • 2
  • 6
  • 17
  • You know that you can use VS "variables" in pre/postbuild events? Like this: xcopy $(TargetDir)*.* $(SolutionDir)Build\ /y >NUL – David Brabant Dec 17 '14 at 10:50
  • yes... but the decision by the company is to take it out of vs and use a cmd file. i fixed it now anyway... needed a better relative path... i was thinking that it was coming from projectdir however it was calling from bin\debug – Simon Price Dec 17 '14 at 11:53

0 Answers0