返回列表 发帖

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

@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

返回列表