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?
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- I want to trace logs using a Macro multi parameter
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- Compile and build with single command line Java (L
- CosmosDB emulator can't start since port is al
- How to print to stdout from Python script with .py
The default code page in
cmd.exe
on my Windows syxtem is 437, which is the default OEM code page for most PC hardware sold in the United States (US) and Western Europe from what I've read. You can change this default by adding a string entry namedAutoRun
under one or both of the keys:and
in the Windows registry, as documented on this MS Windows Server 2003 support page. It describes how you can add a
REG_SZ
string entry namedAutoRun
under one or both of these keys with a value containing commands you want run automatically whencmd.exe
starts up.For example, to make code page 1252 the default, create a new string value named
AutoRun
after navigating to one of these keys in theregedit.exe
utility program and then set its value to the commandchcp 1252
afterwards.Although the MS article only indicates it applies to Windows Server 2003, the technique also worked on the Win XP system I tested it on, so will probably also work with Vista & Win 7.
If Win+R and running
cmd.exe /D
fixes it then the problem is in the cmd autorun value...