|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
『楼 主』:
[求助]使用ANSI.SYS时,如何设置CMD窗口的背景颜色?
使用 LLM 解释/回答一下
在论坛上发现这样的代码,很经典(CMD里显示彩色文字)。
但是搞不懂如何来设置整体的背景颜色。
默认的前景和背景是黑白的。
如果我想要背景是绿色的(color 2)
即:图片的黑色背景换成绿色?图片连接地址
该如何设置?请大家帮忙?
@echo off
::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
jing
Last edited by 516526966 on 2008-10-8 at 02:47 ]
Found such code on the forum, very classic (displaying colored text in CMD).
But I don't understand how to set the overall background color.
The default foreground and background are black and white.
If I want the background to be green (color 2)
That is: change the black background in the picture to green? Image link address
How to set it? Please help everyone?
@echo off
:: Display colored 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
jing
Last edited by 516526966 on 2008-10-8 at 02:47 ]
|
|
2008-10-5 11:58 |
|
|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
在线等待大家的帮助????
没有高手肯帮忙吗?
Last edited by 516526966 on 2008-10-6 at 15:32 ]
Waiting online for everyone's help?????
Is there no expert willing to help?
Last edited by 516526966 on 2008-10-6 at 15:32 ]
|
|
2008-10-6 14:58 |
|
|
wxcute
中级用户
  
积分 458
发帖 211
注册 2006-7-26
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
←[ 相当于开始符
m 相当于结束符
; 相当于分隔符
[1;31;46m
[2;33;41m
改成类似上面的就有背景色了。(我这儿没法测试,你试下)
←
|

┌───────┐
├→学习→实践→┤
└───────┘ |
|
2008-10-6 17:15 |
|
|
wxcute
中级用户
  
积分 458
发帖 211
注册 2006-7-26
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
还有你问题应该改改,应该不是设置窗口背景色
如果那样的话,批处理开头加句
color 21
什么的就行了。
Also, your question should be revised. It shouldn't be about setting the window background color. If that's the case, just add a line at the beginning of the batch file like
color 21
and so on.
|

┌───────┐
├→学习→实践→┤
└───────┘ |
|
2008-10-6 17:21 |
|
|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
Originally posted by wxcute at 2008-10-6 05:21 PM:
还有你问题应该改改,应该不是设置窗口背景色
如果那样的话,批处理开头加句
color 21
什么的就行了。
大哥,我说的是设置窗口的的背景颜色,
不是字体的背景颜色,
我知道color是设置背景和字体。
但是他始终是默认的黑白界面。
Originally posted by wxcute at 2008-10-6 05:21 PM:
You should also modify your question. It shouldn't be about setting the window background color.
If that's the case, add a line at the beginning of the batch script like
color 21
or something like that.
Dude, I'm talking about setting the background color of the window,
Not the background color of the font,
I know that color sets the background and font.
But it always remains the default black-and-white interface.
|

矛盾的世界同样精彩<点击查看> |
|
2008-10-7 19:57 |
|
|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
|
2008-10-8 02:47 |
|
|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
大侠们,帮个忙吧。
拜托了。小弟等着呢?为什么没有人理我
Great experts, please help me.
Please. The younger brother is waiting? Why no one pays attention to me
|

矛盾的世界同样精彩<点击查看> |
|
2008-10-8 20:40 |
|
|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
|
2008-10-10 16:12 |
|
|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
再次请求帮助。或者指点一下也行。没有找到相关的教程。
Again, I ask for help. Or maybe some guidance is also okay. I didn't find relevant tutorials.
|

矛盾的世界同样精彩<点击查看> |
|
2008-10-11 00:09 |
|
|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
真灰心。就没有人知道吗?还是什么原因没人回复。
Really discouraged. Is there really no one who knows? Or what reason is there for no one to reply.
|

矛盾的世界同样精彩<点击查看> |
|
2008-10-15 15:09 |
|
|
tireless
银牌会员
    
积分 2025
发帖 1122
注册 2007-9-5
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
窗口的的背景颜色
与
字体的背景颜色
有何区别?
What is the difference between the background color of the window and the background color of the font?
|
|
2008-10-15 15:22 |
|
|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
|
2008-10-15 15:42 |
|
|
wxcute
中级用户
  
积分 458
发帖 211
注册 2006-7-26
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
在 @echo off 下加 color 2a
如下图:
Add color 2a under @echo off. As shown in the following figure:
附件
1: 难道不是这样吗.gif (2008-10-15 15:46, 10.51 KiB,下载次数: 1)
|

┌───────┐
├→学习→实践→┤
└───────┘ |
|
2008-10-15 15:46 |
|
|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
Originally posted by wxcute at 2008-10-15 03:46 PM:
在 @echo off 下加 color 2a
如下图:
为什么我的不可以,我用的是Windows2003
你是用的什么测试环境。
Originally posted by wxcute at 2008-10-15 03:46 PM:
Add color 2a under @echo off
As shown in the following figure:
Why can't mine work? I'm using Windows 2003
What testing environment are you using.
|

矛盾的世界同样精彩<点击查看> |
|
2008-10-16 01:20 |
|
|
516526966
初级用户
 
积分 63
发帖 37
注册 2008-8-9
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
Originally posted by 516526966 at 2008-10-16 01:20 AM:
为什么我的不可以,我用的是Windows2003
你是用的什么测试环境。
Windows2003下测试结果
我的为什么会是这样的。
Last edited by 516526966 on 2008-10-16 at 01:25 ]
Originally posted by 516526966 at 2008-10-16 01:20 AM:
Why can't mine work? I'm using Windows 2003.
What testing environment are you using?
Test results under Windows 2003
Why is mine like this.
Last edited by 516526966 on 2008-10-16 at 01:25 ]
附件
1: 2008-10-16_010311.jpg (2008-10-16 01:23, 35.48 KiB)
|

矛盾的世界同样精彩<点击查看> |
|
2008-10-16 01:23 |
|