Solved!!
Thats it, I am specifying the solution with the following command:
msbuild /p:Configuration=Debug /p:Platform="Any CPU" Test.sln
Finally the solution was easy, just add double quotes to the copy command, the problem was that when at the beginning I tried that the same problem occurred again but with another project with a similar name, so I got them mixed and thought it was not the solution, I am sorry for bothering you.
copy "$(TargetPath)" "$(SolutionDir)..\CustomFolder\"
Thank you very much for your help.