China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-27 17:26
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Chinese display for 16-bit programs not supported under XP command line? View 4,927 Replies 17
Original Poster Posted 2004-02-06 00:00 ·  中国 山西 运城 联通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
To All:

My XP is the 2002 SP1 version. But whether I go into COMMAND or CMD, after running old 16-bit programs, Chinese cannot be displayed. For example, DEBUG and the like.

Does anyone have a solution?

[ Last edited by willsort on 2005-9-27 at 19:12 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 2 Posted 2004-02-06 00:00 ·  中国 河北 承德 联通
初级用户
Credits 133
Posts 7
Joined 2004-02-02 00:00
22-year member
UID 16573
Gender Male
Status Offline
I saw this method in a newspaper: to use turbo c under xp, enter in cmd
start/separate path\program name
separate means opening up a separate space in memory to run the 16-bit program
there is also a parameter, shared, which starts a 16-bit program in shared memory space; I haven't tried that one
Give it a try
Floor 3 Posted 2004-02-08 00:00 ·  美国
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 4 Posted 2004-02-08 00:00 ·  中国 山西 太原 联通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re ssclose:

Many thanks for the reply!

I have tried this method, but overall, it is not really satisfactory.

I wrote a simple test batch file:

@echo off
echo Chinese display
pause
debug
echo display Chinese

I made a number of changes to the DEBUG line.
ECHO Q>QUIT.ASD
DEBUG 〈 QUIT.ASD
If I don't use START, there are problems with Chinese; if I do use START, there are even more problems. It seems the pipe symbol has a big effect on START, or rather START has a big effect on the pipe symbol. In addition, opening a new window, waiting for the program to execute, and using all those parameters made my XP reboot three times.

Looks like I'd better just stick honestly with my own 98 and DOS6.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 5 Posted 2004-02-08 00:00 ·  中国 山西 太原 联通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re Wengier:

Very regrettably, I can't consider your method. Just to run a simple batch file, I'd need to run a Chinese character support system; even without considering compatibility issues, the cost is too high.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 6 Posted 2004-02-08 00:00 ·  美国
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
Then you'd better just stick honestly with a pure DOS system. But neither 98 nor DOS6 is very practical. MS-DOS 7.10 still has the best compatibility and is also the newest; after all, it's already 2004 now, not 1993-1994 when DOS6 came out!
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 7 Posted 2004-02-09 00:00 ·  中国 浙江 杭州 电信
银牌会员
★★
三生缘里笑红尘
Credits 1,063
Posts 292
Joined 2003-03-09 00:00
23-year member
UID 1073
Gender Male
Status Offline
What a pity!
Floor 8 Posted 2004-02-19 00:00 ·  中国 山西 太原 联通
中级用户
Credits 206
Posts 22
Joined 2004-02-05 00:00
22-year member
UID 16772
Gender Male
Status Offline
Can only say it's a pity. Hopefully in the future someone can make some kind of patch.
But you could also try it through a virtual machine.
Floor 9 Posted 2005-04-08 00:00 ·  中国 山西 太原 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
To All:

  In some tests not long ago, I found a temporary workaround:

  1. Enter XP's DOS console through command, then use graftabl 936; at that point Chinese can be used in 16-bit programs;
  2. Enter through cmd, then use chcp 437 and graftabl 936 respectively; at that point Chinese can also be used in 16-bit programs;

  Also, testing mem in cmd only shows blank lines, but once you use debug in it and exit, mem returns to normal. Other similar old 16-bit DOS programs have the same problem; that is to say, mem needs a certain environment, but only by calling a 16-bit program like Debug can that environment be activated. It is very likely the 16-bit sub-environment of ntvdm, in other words the environment activated by command. But why mem itself does not activate it, and some other programs don't either, is another question.

  Also, what exactly are the differences and connections between the 16-bit environment and the 32-bit environment? From testing, the following differences are known so far; everyone can look for more:

  1. Code page: cmd is 936, command is 437;
  2. Environment variables: cmd has more than command, but command has the sound card blaster;
  3. Startup configuration: command enables config.nt and autoexec.nt;
  4. Shell depth: closing command gives a prompt that it cannot be ended; only after using exit to leave one level of shell can it be closed normally; cmd does not have this problem;
  5. Window title: cmd is 命令提示符, while command is Command Prompt;

[ Last edited by willsort on 2005-9-27 at 19:13 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 10 Posted 2005-09-27 19:03 ·  中国 山西 运城 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
To All:

  Interestingly, for some unknown reason recently, when I enter cmd in “Run” to start the command line, the code page changes to English 437, and running mem no longer has the blank-line flashing problem either. But the version LOGO shown at startup is still XP, only now displayed in English, not the DOS version shown by command. And even if I enter cmd.exe or c:\windows\system32\cmd.exe, the result is the same.

  But if I click the “Command Prompt” shortcut in the Accessories menu under Start, or directly click cmd.exe under system32, the code page displays Chinese normally.

Title: C:\windows\system32\cmd.exe
=====================
Microsoft Windows XP
(C) Copyright 1985-2001 Microsoft Corp.
=====================
The command line window obtained by entering cmd in “Run”

Title: 命令提示符
=====================
Microsoft Windows XP
(C) 版权所有 1985-2001 Microsoft Corp.
=====================
The command line window obtained by directly clicking the shortcut

Title: Command Prompt
=====================
Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.
=====================
The command line window obtained by entering command in “Run”

Please note that their copyright date ranges are also different.

[ Last edited by willsort on 2005-9-27 at 19:15 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 11 Posted 2005-10-15 11:31 ·  中国 山西 临汾 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re All:

As for the code page issue in post #10, it has been verified that it is caused by some item in the registry being modified, as follows:


"CodePage"=dword:000001b5


The 1b5 there is the hexadecimal notation for 437 (OEM United States).

As for the problem mentioned in post #9 where executing mem in cmd shows blank lines, the specific behavior is as follows:

If you enter the command line window by running CMD or by clicking the Command Prompt in the menu, then directly execute mem or some other older 16-bit DOS program, it will immediately switch the chcp code page to 437. This switching action clears the screen, then shows 11 blank lines. But if you directly execute mem>mem.txt, the switching action still occurs, only the number of blank lines displayed becomes 1, while mem.txt shows 11 lines of text.


Invalid keyboard code specified


655360 bytes total conventional memory
655360 bytes available to MS-DOS
633664 largest executable program size

1048576 bytes total contiguous extended memory
0 bytes available contiguous extended memory
941056 bytes available XMS memory
MS-DOS resident in High Memory Area


Therefore the following guesses can be made:

1. Those 11 blank lines in the former case are exactly the contents of mem.txt.
2. The Invalid sentence on the first line of mem.txt indicates that the program uses a Keyboard Code incompatible with the current Windows, and according to testing, no 16-bit DOS program has yet been found that can solve this compatibility problem.
3. The forced Code Page switch may originate from this invalid Keyboard Code.
4. And since after the code page switch the program output still cannot be displayed normally, that means the program output is still not compatible with this code page, while DEBUG can make adjustments.
5. According to the hint from Wengier in http://www.cn-dos.net/forum/viewthread.php?tid=1019, after switching the command line window to full screen and then executing programs like mem, the problem pointed out in guess 4 will not appear, so this kind of switching should have performed a corresponding adjustment action just like the piece of code in debug.

[ Last edited by willsort on 2005-10-15 at 12:32 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 12 Posted 2005-10-15 12:09 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Originally posted by willsort at 2005-9-27 19:03:
To All:

  Interestingly, for some unknown reason recently, when I enter cmd in “Run” to start the command line, the code page changes to English 437, and running m..

That was caused by you changing cmd's properties! If you can change the properties back to normal, there won't be any problem!
Floor 13 Posted 2005-10-15 12:32 ·  中国 山西 大同 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re qwe1234567:

Then try modifying cmd's code page property manually instead of through the registry, and make that change apply to all command line windows opened afterward. I could never find where the manual option for this change was. But after deleting that registry branch, the command line window had already returned to normal.

----------------------------------------------------------------------------------------------------
Sorry! After I made this post and went to look again, I unexpectedly found this option entry.

After opening the command line window, press Alt+Space, D in sequence to enter the “Console Window Properties” dialog box, then on the “Options” tab adjust the “Default code page”. I used to always press Alt+Space, D, but the result was always entering the “C:\windows\system32\cmd.exe” Properties dialog box, where the code page cannot be adjusted.

However, this option modifies the code page for all consoles, and the corresponding registry branch is:


"CodePage"=dword:000003a8

As for the original , I don't know how it was created.


[ Last edited by willsort on 2005-10-15 at 12:50 ]
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 14 Posted 2005-11-03 21:26 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 15 Posted 2007-02-11 14:28 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline

chcp 437>nul&graftabl 936>nul


http://www.cn-dos.net/forum/viewthread.php?tid=26795

Brother WillSort really was amazing!!! Miss him ing...

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Forum Jump: