Page 1 of 1
Color in batch programs
Posted: 08 Feb 2016 21:20
by mirrormirror
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=3428Also, 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#p41335I 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?
Re: Color in batch programs
Posted: 09 Feb 2016 04:42
by npocmaka_
what about powershell and .net solutions? They are faster than FINDSTR and do not require external binaries.
Re: Color in batch programs
Posted: 09 Feb 2016 08:49
by Ed Dyreen
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.
Re: Color in batch programs
Posted: 09 Feb 2016 15:57
by mirrormirror
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.
Re: Color in batch programs
Posted: 09 Feb 2016 21:39
by Squashman
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
Re: Color in batch programs
Posted: 09 Feb 2016 23:26
by mirrormirror
Did that already but just wanted to mention the search issue I had.
Re: Color in batch programs
Posted: 10 Feb 2016 06:27
by foxidrive
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.
Re: Color in batch programs
Posted: 10 Feb 2016 12:49
by Aacini
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
Re: Color in batch programs
Posted: 10 Feb 2016 17:04
by mirrormirror
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.
Re: Color in batch programs
Posted: 11 Feb 2016 05:28
by siberia-man
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