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

前端 未结 8 1390
温柔的废话
温柔的废话 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:41

    This is not a problem with Windows 7 or 8. It's actually a problem with applications that update environment variables such as PATH. The PATH is stored in the Registry as an "Expandable string value" (REG_EXPAND_SZ), but a lot of applications write it back to the Registry as a "String Value" (REG_SZ). If your path contains anything like %SYSTEMROOT%, this will not be expanded into C:\Windows (or whatever yours is) if the path is stored in a REG_SZ.

    The fix is simply to edit your path manually from the control panel. You need to make a change (eg add a ; to the end of the path) and then apply it. This will fix up your path in the Registry to be a REG_EXPAND_SZ. (Go to the System Control Panel and select Advanced System Settings. Edit the Path Environment variable in the lower box, and that should fix it.

    You can tell whether your path is broken in this way by opening a command prompt and typing PATH. Your path will be listed. If you can see anything enclosed in % % then your path is not being expanded.

提交回复
热议问题