bat 字体颜色

2024-12-25 14:20:42
推荐回答(2个)
回答1:

@echo off
chcp 437>nul
mode concols=82lines=32
echo 1
echo *//----------------------------\\*&color 0a&call:Loop
rem "echo 1"显示"1",则绿.
echo 2
echo *//----------------------------\\*&color 0c&call:Loop
rem "echo 2"显示"2",则红.
echo 3
echo *//----------------------------\\*&color 0e&call:Loop
rem "echo 3"显示"3",则黄.
goto :eof
:Loop
pause
rem 英文原版的颜色才是正宗的!汉化版的颜色都不对!

rem 给分吧..

回答2:

百度不支持某些符号,运行这个批处理后,会生成一个新的批处理。
想显示其他字符的话,把for %%1 in (%clos%) 改成不带参数的for ,或者改成for /f从文件读取

'& @echo off& setlocal enabledelayedexpansion
'& wind& start wscript /e:vbs "%~F0"& exit
set fso = createobject("scripting.filesystemobject"): set ofrd = fso.opentextfile(wscript.scriptfullname,1)
while ofrd.atendofstream = false
wind_L = wind_L + 1
wind_LST = ofrd.readline
if instr(wind_LST,"#") > 0 and left(wind_LST,1) = "'" then
set ofwr = fso.opentextfile("wind_snow.bat",2,true)
wind_LST = mid(wind_LST,2): wind_vbcrlf = split(wind_LST,"#"): for each wind_HC in wind_vbcrlf
ofwr.writeline replace(wind_HC,".wind",chr(8) & " ")
next
end if: wend
'@echo off& setlocal enabledelayedexpansion& if not "%~1"=="" erase "%~1"#(for /l %%1 in (1 1 9)do set clos=!clos! %%1)&& set clos=!clos! a b c d e f#set /a wind_cx=-1&& for %%1 in (%clos%)do (set /a wind_cx+=1#for /l %%2 in (0 1 14)do (if !wind_cx!==%%2 set smile_%%2=%%1))#for /l %%1 in (1 1 20)do (set /a snow+=1,snow=snow %% 15#echo..wind>%%1& call findstr /a:%%smile_!snow!%% ".*" %%1?& erase=%%1)#pause 1>nul
ofwr.close
createobject("wscript.shell").run """wind_snow.bat"" """&wscript.scriptfullname&""""