返回列表 发帖

[游戏娱乐] 批处理彩色显示字符串

@echo off & color 0f
set tempDir=%HOMEDRIVE%\~colorIt
(md !tempDir! 2>nul)&(call :delFiles %tempDir%)&(cd /d %tempDir%)&(set /p=<nul>temp)
(call :colorIt 01 蓝)&(call :colorIt 02 绿)&(call :colorIt 04 红)&(call :colorIt 06 黄)
(call :colorIt f0 彩色显示关键是)&(call :colorIt 24 findstr-a参数)&(call :colorIt 16 的使用和含一个退格字符的文件)
(call :delFiles %tempDir%)&pause & color /? & pause &exit /b
:colorIt !color! !it!
ren temp %2>nul 2>nul
findstr -a:%1 . %2*
ren %2 temp>nul 2>nul
exit /b
:delFiles 强力删除一个目录中的所有文件
del /f /a /q \\?\%1
exit /bCOPY

相关讨论

CMD里显示彩色文字
http://bbs.bathome.net/thread-1852-1-1.html

批处理单行输出彩色字符
http://bbs.bathome.net/thread-1853-1-1.html

批处理单行显示多种颜色字符
http://bbs.bathome.net/thread-1854-1-1.html

批处理显示彩色字符的原理及其中退格符的作用
http://bbs.bathome.net/viewthread.php?tid=1331#pid11864
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

返回列表