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-24 00:00
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 【Original】Beyond the color command - Display colored text in CMD (valid for XP/Vista) View 18,540 Replies 70
Floor 31 Posted 2007-05-09 15:16 ·  IANA 局域网IP(Private-Use)
中级用户
★★
蝴蝶之吻
Credits 430
Posts 177
Joined 2006-09-20 12:00
19-year member
UID 63170
From 广东深圳
Status Offline
Okay....Nice,,,added points....Hehe...
Floor 32 Posted 2007-05-09 22:37 ·  中国 四川 泸州 联通
高级用户
★★★
Credits 609
Posts 374
Joined 2006-08-02 22:38
19-year member
UID 59720
Status Offline
Originally posted by studythedos at 2007-5-9 13:26:
Why can it only be displayed once,
When running again, there is nothing.


It can't only be displayed once! Each start is the same.
@echo off
:: Display colorful text in CMD
chcp 437>nul&&graftabl 936>nul
if not exist CONFIG.NT copy %WinDir%\System32\CONFIG.NT CONFIG.NT
@cls
echo DEVICE=%WinDir%\System32\ANSI.SYS /x >%WinDir%\System32\CONFIG.NT
@echo.
command /cecho 
command /cecho 


























































Floor 33 Posted 2007-05-09 23:59 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Originally posted by ZJHJ at 2007-5-9 22:37:
It can't be displayed only once! Every time you start up, it's the same.

I tested many times, and it only displays once. When running again, there is no effect.

I think everyone says "only displays once" because they said so after testing, and they don't say it for no reason. So we should analyze the reason.
Floor 34 Posted 2007-05-10 16:51 ·  中国 山东 枣庄 滕州市 联通
初级用户
Credits 61
Posts 32
Joined 2007-05-09 17:09
19-year member
UID 87974
Gender Male
Status Offline
Chinese can also be colorful
Floor 35 Posted 2007-05-10 19:52 ·  中国 四川 泸州 联通
高级用户
★★★
Credits 609
Posts 374
Joined 2006-08-02 22:38
19-year member
UID 59720
Status Offline
Originally posted by lxmxn at 2007-5-9 23:59:

I have tested many times, and it only shows once. When I run it again, there is no effect.

I think everyone saying "only shows once" is what they said after testing, and they won't say it without reason, so we should analyze the reason.


My system is XP SP2. The one I modified starts on my machine, and it is normal every time. Because sometimes the first line is not displayed when starting, so I added an empty line in front. When starting, it will modify the content of the CONFIG.NT file (if not modified, it will not display normally). Since the original file content is what program uses, so when exiting, restore the original file. If using bak to back up CONFIG.NT, which is CONFIG.NT.bak, but I can't find CONFIG.NT.bak in the System32 folder. For safety, I used copy.
Floor 36 Posted 2007-05-10 23:32 ·  中国 湖北 黄冈 电信
高级用户
★★★
Credits 894
Posts 411
Joined 2007-02-17 12:15
19-year member
UID 79697
Gender Male
Status Offline
How to use that ANSI editor?
@set c= 不知则觉多,知则觉少,越知越多,便觉越来越少. --- 知多少.
@for,/l,%%i,in,(1,1,55)do,@call,set/p=%%c:~%%i,1%%<nul&ping/n 1 127.1>nul


Floor 37 Posted 2007-05-10 23:34 ·  中国 湖北 黄冈 电信
高级用户
★★★
Credits 894
Posts 411
Joined 2007-02-17 12:15
19-year member
UID 79697
Gender Male
Status Offline
So beautiful! Why use the config.nt file?
@set c= 不知则觉多,知则觉少,越知越多,便觉越来越少. --- 知多少.
@for,/l,%%i,in,(1,1,55)do,@call,set/p=%%c:~%%i,1%%<nul&ping/n 1 127.1>nul


Floor 38 Posted 2007-06-20 00:47 ·  中国 上海 电信
初级用户
Credits 170
Posts 24
Joined 2004-06-01 00:00
22-year member
UID 25833
Status Offline
Floor 39 Posted 2007-06-20 01:04 ·  中国 湖南 长沙 电信
初级用户
★★
Credits 182
Posts 75
Joined 2006-10-11 00:10
19-year member
UID 65220
Gender Male
Status Offline
Interesting, sometimes it works and sometimes it doesn't on the 32nd floor.
Only once can I see it between the two times.

Can anyone explain in detail what the.CONFIG.NT file is?
Floor 40 Posted 2007-06-25 12:17 ·  中国 上海 浦东新区 电信
中级用户
★★
Credits 302
Posts 138
Joined 2007-03-29 02:33
19-year member
UID 83224
Gender Male
Status Offline
LZ, I have the same problem here. It worked successfully the first time, but then it couldn't display anymore.
Floor 41 Posted 2007-06-25 19:48 ·  中国 四川 成都 双流区 电信
新手上路
Credits 4
Posts 2
Joined 2007-06-25 19:27
18-year member
UID 92331
Gender Male
Status Offline
Next attachments all require points! Annoying!
Floor 42 Posted 2007-06-25 22:23 ·  中国 四川 成都 联通
中级用户
★★
Credits 346
Posts 103
Joined 2004-04-06 00:00
22-year member
UID 21852
Gender Male
Status Offline
This is the forum setting. I didn't set the points on purpose.
Floor 43 Posted 2007-06-26 17:08 ·  中国 北京 鹏博士BGP
中级用户
★★
Credits 404
Posts 179
Joined 2006-03-30 14:44
20-year member
UID 53056
Status Offline
```
@echo off &setlocal enableextensions enabledelayedexpansion
chcp 437>nul&&graftabl 936>nul
copy %WinDir%\System32\CONFIG.NT CONFIG.NT >nul 2>nul
echo DEVICE=%WinDir%\System32\ANSI.SYS /x >%WinDir%\System32\CONFIG.NT
cls
set cecho_=command /cecho
for /l %%i in (0,1,7) do (
for /l %%j in (2,1,9) do (
set /a k=%%j-2
%cecho_%






Attachments
新建 BMP 图像.JPG
Floor 44 Posted 2007-09-04 11:30 ·  中国 江苏 苏州 电信
初级用户
Credits 48
Posts 25
Joined 2007-07-30 17:57
18-year member
UID 94318
Gender Male
Status Offline
Floor 45 Posted 2007-09-05 23:36 ·  中国 陕西 安康 电信
初级用户
★★
Credits 171
Posts 78
Joined 2006-11-22 11:26
19-year member
UID 71373
Gender Male
Status Offline
Forum Jump: