Color in batch programs

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
mirrormirror
Posts: 129
Joined: 08 Feb 2016 20:25

Color in batch programs

#1 Post by mirrormirror » 08 Feb 2016 21:20

Questions on advantages/features/drawbacks to the various color utilities mentioned in the forums.
I've used colorshow.exe from Aacini: http://www.dostips.com/forum/viewtopic.php?f=3&t=3428

Also, another batch solution found on stackoverflow that I think was made by jeb - it mainly uses findstr.

And I also saw this post from carlos referencing "out.exe" :http://www.dostips.com/forum/viewtopic.php?f=3&t=4881&start=15#p41335

I know the findstr solution is slower than the colorshow.exe - and also colorshow.exe seems more robust in its features/options but I haven't used out.exe

So can anyone comment on any other advantages/features/drawbacks of these utilities?

npocmaka_
Posts: 512
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

Re: Color in batch programs

#2 Post by npocmaka_ » 09 Feb 2016 04:42

what about powershell and .net solutions? They are faster than FINDSTR and do not require external binaries.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Color in batch programs

#3 Post by Ed Dyreen » 09 Feb 2016 08:49

That depends on the OS, on mine both powershell and .net are external binaries and .net is bloated.
The findstr program is native and slow.
Aacini's binary is fast, requires no installation, and can be build from native batch.

mirrormirror
Posts: 129
Joined: 08 Feb 2016 20:25

Re: Color in batch programs

#4 Post by mirrormirror » 09 Feb 2016 15:57

Any comments on the differences between the "colorshow.exe" and "out.exe" utilities?

p.s. it is difficult to search the forum for "out.exe" because it won't search the whole string, but rather separates them into two words and refuses to run the search.

Squashman
Expert
Posts: 4471
Joined: 23 Dec 2011 13:59

Re: Color in batch programs

#5 Post by Squashman » 09 Feb 2016 21:39

mirrormirror wrote:p.s. it is difficult to search the forum for "out.exe" because it won't search the whole string, but rather separates them into two words and refuses to run the search.

There is this really cool search engine called google.
http://lmgtfy.com/?q=%22out.exe%22+site%3Adostips.com

mirrormirror
Posts: 129
Joined: 08 Feb 2016 20:25

Re: Color in batch programs

#6 Post by mirrormirror » 09 Feb 2016 23:26

There is this really cool search engine called google.
http://lmgtfy.com/?q=%22out.exe%22+site%3Adostips.com


Did that already but just wanted to mention the search issue I had.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Color in batch programs

#7 Post by foxidrive » 10 Feb 2016 06:27

mirrormirror wrote:just wanted to mention the search issue I had.


I've found that many forum search engines are limited. Squashman's suggestion is what I use too, with autohotkey to drive it using a hotkey.

Aacini
Expert
Posts: 1885
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Color in batch programs

#8 Post by Aacini » 10 Feb 2016 12:49

npocmaka_ wrote:what about powershell and .net solutions? They are faster than FINDSTR and do not require external binaries.

Excuse me, but I disagree. The findstr.exe file is 30208 bytes long and powershell.exe is 474624 bytes (in my Win 8.1 computer), so if a Batch file use findstr/powershell methods to show text lines in color, I would not be surprised if the findstr method run at least 10 times faster than the powershell one. Perhaps it would be interesting to complete a timing test...

Antonio

mirrormirror
Posts: 129
Joined: 08 Feb 2016 20:25

Re: Color in batch programs

#9 Post by mirrormirror » 10 Feb 2016 17:04

Just to add a bit of info / comparison between out.exe (from carlos) and colorshow.exe (from antonio):

out.exe: found here:http://consolesoft.com/p/out/
Unicode output
The text accept the next regular expressions:

\b backspace
\r carriage return
\d new line
\t horizontal tab

colorshow.exe (find here in forums viewtopic.php?f=3&t=3428 )
Not sure of unicode functionality - I do not need it at the moment.
From the documentation, it seems to have more functionality and be a bit more flexible for displaying variables, justifying text, etc.

I have only used colorshow.exe so I can't compare speed, etc.

siberia-man
Posts: 208
Joined: 26 Dec 2013 09:28
Contact:

Re: Color in batch programs

#10 Post by siberia-man » 11 Feb 2016 05:28

What about this one?

ANSI escape-oriented PowerShell script: https://github.com/ildar-shaimordanov/c ... r/ansi.bat

Reading from command line arguments

Code: Select all

ansi "\e[47m      \e[0m\n\e[44m      \e[0m\n\e[41m      \e[0m"
Reading from pipeline

Code: Select all

echo \e[47m      \e[0m\n\e[44m      \e[0m\n\e[41m      \e[0m | ansi
Reading from pipeline of few commands

Code: Select all

(
	echo \e[47m      \e[0m
	echo \e[44m      \e[0m
	echo \e[41m      \e[0m
) | ansi

Post Reply