-3

I once got this program from somewere to make the text different colours and it works.

but, what I want to know is how does it work

>  @echo off
>     <nul set /p .=. > "%~2"
>     findstr /v /a:%1 /R "^$" "%~2" nul
>     echo(%DEL%%DEL%%DEL%
>     del "%~2" > nul 2>&1
>     goto :eof

1 Answers1

0

findstr is a command that locates files containing a given string of plain text. An interesting feature of this command is that it lets you specify the colors it outputs in, which is exploited in your code.

Your code, which resembles some code over here, makes a file with the text you want to colorize and uses findstr to print out the name of the file. Then, it deletes the temporary file.

Community
  • 1
  • 1
APerson
  • 8,140
  • 8
  • 35
  • 49