How to change codepage for MSBUILD?

js83 1 Reputation point
2021-04-02T08:46:52.713+00:00

Hi.

I set chcp to 437 and run MSBuild, but MSBuild reset to 65001.
How can I lock chcp to 437 during running time MSBuild?

I did type like this in cmd...


chcp 437
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe" /p:Configuration="Development" /p:Platform=Win64 C:\Project\Project.sln


and cmd output...


Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 4/2/2021 5:31:14 PM.
Project "C:\Project\ProjectER.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Development|Win64".
Project "C:\Project\Project.sln" (1) is building "C:\Project\Project.vcxproj" (2) on node 1 (default targets).
Build:
C:\WINDOWS\System32\chcp.com 65001 >NUL
......


How can I remove "C:\WINDOWS\System32\chcp.com 65001 >NUL" command?

Other PC don't execute chcp command. But my builder PC execute chcp during MSBuild running time.

Thanks.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,252 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dylan Zhu-MSFT 6,406 Reputation points
    2021-04-05T03:04:46.283+00:00

    Hi js83,

    It seems to be set as default in your registry. You can go to [HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun], then confirm if it has been written in @chcp 65001>nul

    Best Regards, Dylan

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our * *documentation* to enable e-mail notifications if you want to receive the related email notification for this thread.**