title: What encoding/code page is cmd.exe using when it is started?
body: <p>A nearly identical question was asked before. A good explanation of code pages was given in the reply, but it did not answer the question in my mind: What controls the code page used when cmd.exe is started? On my system, it gets changed somehow. In the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage, there is an item OEMCP that is set to 437. This seems to be the CP used by cmd.exe (as shown by chcp) after a fresh reboot, but something changes it later and it becomes 1252 in new cmd.exe windows. If I change it with chcp to 437, that only affects the current cmd.exe. When I exit and restart cmd.exe, chcp shows 1252 in the new window. What controls the default CP used when cmd.exe is started? How does it get changed from the value in the registry? How do I keep it from getting changed and/or change it back to 437 for new command windows?</p>