(Solved) Batch file in color

(Solved) Batch file in color

How to set text color in batch file

colorecho

batch


@Echo Off
title: Color text code By http://ibraransari.blogspot.in
color 0a
echo.
echo    ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo    º  Color Batch File By http://ibraransari.blogspot.in  º
echo    ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
:: ------------------ Set Display Parameter ----------------- ::
SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do     rem"') do (
  set "DEL=%%a"
)
:: ------------------ End Set Display Parameter ----------------- ::

echo.
echo.
:: ------------------ Start Line in Color. ----------------- ::
ECHO|set /p ="       Add "
call :colorEcho 0a "Block "
call :colorEcho 0e " in "
call :colorEcho 0a " & Out"
call :colorEcho 0b " Including subfolders" 
ECHO  Firewall rules
ECHO.
:: ------------------ End Line in Color. ----------------- ::

:: ------------------ Start Line in Color. ----------------- ::
call :colorEcho 0a "This is colored green with a black background!"
echo.
echo.
call :colorEcho c0 "This is colored black with a Red background!"
echo.
echo.
echo.
:: ------------------ End Line in Color. ----------------- ::

:: ------------------ Start Line in Color. ----------------- ::
ECHO|set /p = " File located at '"
call :colorEcho 0b "%CD%'" 
call :colorEcho 0a "Including subfolders"  
ECHO.
echo.
echo.
:: ------------------ End Line in Color. ----------------- ::

:: ------------------ Start Line in Color. ----------------- ::
call :colorEcho 0a "green"
call :colorEcho 0C " red"
call :colorEcho 0b " cyan"
call :colorEcho 0c " dgd"
call :colorEcho 0d " cysgan"
echo.
echo(
call :colorEcho 19 "blue"
call :colorEcho 2F " white"
call :colorEcho 4e " yellow"
echo.
echo.
echo.
:: ------------------ End Line in Color. ----------------- ::
:: End
Pause
exit
:: ------------------ Set Display Parameter ----------------- ::
:colorEcho
echo off
"%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1i
:: ------------------ End Display Parameter ----------------- ::


SHARE

Ibrar Ansari

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment