Advertisement
IcarusLives

:multiColor Function

Jun 30th, 2017
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.83 KB | None | 0 0
  1. @echo off & setlocal enableDelayedExpansion
  2.  
  3. rem Code for color support
  4. for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E & echo on & for %%b in (1) do rem"') do set "DEL=%%a"
  5. <nul set /p ".=%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%" > "'"
  6.  
  7. call:multicolor "text ".0A "in ".CF "color".5d
  8.  
  9. pause & exit
  10. rem -----------------------------------------------------------------------------------------
  11. :multicolor
  12.     setlocal
  13.         (for %%a in (%*) do ( set /a "arguments+=1"
  14.             for /f "tokens=1,2 delims=." %%0 in ("%%~a") do if "%%1" neq "" (
  15.                     set "T[!arguments!]=%%~0"
  16.                     set "c[!arguments!]=%%~1"
  17.                     for /f "tokens=*" %%2 in ("T[!arguments!]") do set "%%2=!%%2:~0,-1!"
  18.         )))
  19.         (for /l %%a in (1,1,%arguments%) do >cp.txt ( echo=!t[%%a]!\..\') && findstr /a:!c[%%a]! /f:cp.txt ".")
  20.         echo.
  21.     endlocal
  22. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement