Board logo

标题: [游戏娱乐] 批处理彩色显示字符串 [打印本页]

作者: neorobin    时间: 2009-12-13 22:07     标题: 批处理彩色显示字符串

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

作者: Batcher    时间: 2009-12-13 22:12     标题: 相关讨论

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




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2