question

js83-6292 avatar image
0 Votes"
js83-6292 asked DylanZhu-MSFT commented

How to change codepage for MSBUILD?

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.

vs-msbuild
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DylanZhu-MSFT avatar image
0 Votes"
DylanZhu-MSFT answered DylanZhu-MSFT commented

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.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks about your answer.

There is not [HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun] on my PC registry.
84288-image.png




And already I found all key what used 65001 value, and I set to 437.
But MSBuild output "C:\WINDOWS\System32\chcp.com 65001 >NUL" ..

0 Votes 0 ·
image.png (19.1 KiB)

I copied "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild" folder from 437 PC to 65001 PC, and launch build with copied MSBuild then chcp not run.
I guess MSBuild.exe contain the chcp command.

0 Votes 0 ·

Hi @js83-6292, you can try to rename your all folders in English in 65001 PC.

0 Votes 0 ·