xcopy is not recognized as an internal or external command, operable program or batch file

前端 未结 8 1387
温柔的废话
温柔的废话 2021-01-03 18:08

I have a problem using \'xcopy\' command.

I\'m building a C# project with msbuild. At the end of the build, a batch file is called to copy my assemblies from Debug/R

8条回答
  •  [愿得一人]
    2021-01-03 18:46

    I encountered the same problem.

    It seems to be a problem with the path environment variable within Visual Studio.

    When I added a "path" statement to the beginning of my build event, it produced the following output:

    PATH=
    

    This seems to indicate that the path is empty within the VS build environment.

    When I specify the full path to xcopy like this, the problem went away:

    %systemroot%\System32\xcopy ...
    

    I'm not sure what caused Visual Studio to lose it's path.

提交回复
热议问题