Hack Forums
[Shell] [Batch] Multi-coloring - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] [Batch] Multi-coloring (/showthread.php?tid=4993034)



[Batch] Multi-coloring - Alumni Theorist - Sep 19, 2015

Hello! I made this thread as many people seem to not know how to use multiple colors on the same line of text or several lines of text in batch. I did not originally make this script I just tweaked it a bunch.

This would go at the beginning of your script after "@echo off" (if used):
PHP Code

<?php 
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do     rem"') do (
  
set "DEL=%%a"
) 

Now, this piece of code would go at the very end of your code, after all the functions you wish to implement color into:
PHP Code

<?php 
:colorEcho
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del 
"%~2" > nul 2>&1i 

Now, to utilize this, we will use the 'call' function.
Example:
PHP Code

<?php 
call 
:colorEcho 0a "text1"
call colorEcho 0b " text2" 
This would display text1 text2
on the same line. In order to separate the lines so it displays as
"text1."
"text2."
It would look like this:
PHP Code

<?php 
call 
:colorEcho 0a "text1" & echo.
call :colorEcho 0b "text2" & echo. 

That is all! You now have multicolored text <3


* - Ventriloquism - Sep 19, 2015

You literally copied the script above from this thread made by Icarus.

Also, how is this a tutorial? You never really explained how the code works...only how to use it.

ScriptKiddy 🤫 Just leave...


* - Joeyman1117 - Sep 20, 2015

If it isnt yours dont use it, ok?
Some one had the hard job to do it


* - annikk.exe - Sep 20, 2015

This was (at least partially) original research by IcarusLives, and this user has copied it and tried to present it as their own work.
I guess OP is looking forward to their new career as a Red Apple Cart Pusher..


* - ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ - Sep 20, 2015

There are bits and pieces of this code everywhere. I now actually use a modified version of what OP posted, since I find it cleaner, and more effective. This is my own, not only that, but I've found a replacement backspace symbol that I use instead of generating one.


* - Alumni Theorist - Oct 11, 2015

I found the first part of the code myself, but odviously didn't work so I completed it. I guess I will go to my own forum if this forum doesn't appreciate me.


And, like I said, I DID NOT MAKE THIS SCRIPT, I JUST TWEAKED IT!
To those of you saying I leeched it & was dishonest about it being mine need to READ THE FUCKING OP


(Sep 19, 2015 01:15 PM)SkÑ–d Wrote:  You literally copied the script above from -snip-

Also, how is this a tutorial? You never really explained how the code works...only how to use it.

ScriptKiddy 🤫 Just leave...

Only the first for /f statement is the same because I found it off yahoo answers then I added the second part. Look at the :colorText variable in that thread and compare it to mine, that I made myself.


* - annikk.exe - Oct 12, 2015

Nobody suggested that you claimed to have written it.
Nevertheless, you copied some original content and posted it, without crediting the author.
We consider that bad behaviour. Do you understand why we feel that way?


* - SavageBoys - Oct 12, 2015

Add credits/links to the sources you used and make clear what work you put into it. I'm sure most will let it go with that as long as it doesn't become a recurring thing.

Quote:I guess I will go to my own forum if this forum doesn't appreciate me.


Seriously? You're going to be melodramatic now? Its not cute. We don't care.

And seeing as you edited your post after the first comment calling you out.. you really have no right to say "READ THE FUCKING OP" seeing as you didn't admit to it from the beginning.


* - Alumni Theorist - Jul 5, 2016

I've never seen the post about this before? I originally made this script back in '07.


* - ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ - Jul 5, 2016

(Jul 5, 2016 01:30 AM)Alumni Theorist Wrote:  I've never seen the post about this before? I originally made this script back in '07.

Lol, you still think you made this?


* - Phlox - Jul 15, 2016

I made the tutorial ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ stole it from me haha joke very nice tutorial ɩᴄᴀʀᴜȿ ᴌוᴠᴇѕ™ thanks for sharing it with us.

FreeBooter!


* - Aggelos - Jul 19, 2016

This don't work good.
I see: Text1 #<-# Pres any button to continue
Text2 #<-# Pres any button to continue

FINDSTR: Don't find next /a

What to do?