Created
August 2, 2014 02:10
-
-
Save psyrendust/a3ca1eb640475cd40a99 to your computer and use it in GitHub Desktop.
Testing colored output from a windows batch file running in cmd.exe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Testing color output in a batch script | |
:: Rendering is slow, but you get pretty colors | |
call:logblue "-- blue" | |
call:loggreen "-- green" | |
call:logcyan "-- cyan" | |
call:logred "-- red" | |
call:logmagenta "-- magenta" | |
call:logyellow "-- yellow" | |
call:loggray "-- gray" | |
call:logwhite "-- white" | |
pause | |
:logblue | |
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Blue %1 | |
goto:eof | |
:loggreen | |
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Green %1 | |
goto:eof | |
:logcyan | |
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Cyan %1 | |
goto:eof | |
:logred | |
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Red %1 | |
goto:eof | |
:logmagenta | |
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Magenta %1 | |
goto:eof | |
:logyellow | |
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Yellow %1 | |
goto:eof | |
:loggray | |
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Gray %1 | |
goto:eof | |
:logwhite | |
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor White %1 | |
goto:eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment