title: Why do all Pre-build or Post-build events in Visual Studio fail with exit code 1?
body: <p>My goal is copying an .exe file from a bin folder of solution A to another solutions B resource folder on the post build event of solution A.<br>
  I created the necessary xcopy command and tried it out in powershell: It works perfectly.<br>
  Whenever I add any command to the actions in VS build fails with: "#command# exited with code 1", where #command# is, for example, the xcopy command.<br>
  I tried running VS as admin and currently I tried just running a .bat file that contains "@echo off @exit 0". That too leads to "#command# exited with code 1".<br><br>
  Have some example of what I tried out as VS post/pre-build command:<br>
  call "projdir\test.bat"<br>
  call projdir\test.bat<br>
  "projdir\test.bat"<br>
  projdir\test.bat<br>... I tried projdir as "$(ProjectPath)" and manual path.<br><br>
  I put output to verbose and found the following:<br>The command "C:\Users\Traubenfuchs\AppData\Local\Temp" is written incorrectly or couldn't be found. (That folder actually exists but I don't know what it wants to do it.)<br>The same thing happens when I put an xcopy command in pre/post build.<br><br>
  Anyone knows what I am doing wrong?</p>
  
  <p><img src="https://i.stack.imgur.com/yiJ00.png" alt="enter image description here"></p>