using a relative path in PostBuild.cmd for postbuild event visual studio

924 views Asked by At

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

0

There are 0 answers