Perhaps it doesn’t like absolute paths? It runs the commands from your project directory, so maybe this will work:
rmdir ..\_compiled\$(TargetBuild)\$(ProjectName) /s
mkdir ..\_compiled\$(TargetBuild)\$(ProjectName)
xcopy /y /s "$(OutputDir)\bin\$(TargetBuild)\bin" ..\_compiled\$(TargetBuild)\$(ProjectName)
Failing that, it’s time to make a batch file and put all your commands in there. You’ll need to pass $(TargetBuild)
and $(ProjectName)
as parameters, but it should be more reliable overall.