Skip to content

Instantly share code, notes, and snippets.

@npocmaka
Created April 26, 2016 10:07
Show Gist options
  • Save npocmaka/2f762230efb8da0d71fde68cad122f5c to your computer and use it in GitHub Desktop.
Save npocmaka/2f762230efb8da0d71fde68cad122f5c to your computer and use it in GitHub Desktop.
@Echo Off
mode 109,13
color F0
rem chcp 65001
chcp 437
cls
setlocal enableDelayedExpansion
::Define a Linefeed variable
set LF=^
::above 2 blank lines are critical - do not remove.
call :hexprint "0xDB" B
call :hexprint "0xDD" L
call :hexprint "0xDE" R
call :hexprint "0xFE" M
call :hexprint "0xB0" D
call :hexprint "0xB2" S
set "l11= %S%%B%%B% %R%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%L% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %R%%B%%B%%B%%B%%B%%B%%B%%B%%L% %B%%B%%B%%D% %B%%B%%B%%B% "
set "l21= "
set "l12= %B%%B%%B%%B%%B% %R%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%L% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B% %B%%B%%B%%B%%B% %B%%B%%B%%B% "
set "l22= "
set "l13= %B%%B%%B%%B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B%%L% %R%%B%%B%%B%%B% %B%%B%%B%%B%%B%%B% %B%%B%%B%%B% "
set "l23= "
set "l14= %B%%B%%B%%B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B%%B%%B%%B%%B% %B%%B%%B% "
set "l24= "
set "l14= %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B%%B%%B%%B% %B%%B%%B%%B% "
set "l24= %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%S%"
set "l15= %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% "
set "l25= %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%"
set "l16= %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B%%L% %R%%B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B%%B%%B%%B% "
set "l26= %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%"
set "l17= %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B% %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B%%B% "
set "l27= %B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%"
set "l18=%B%%B%%B%%D% %B%%B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %B%%B%%B%%B% %D%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B% %R%%B%%B%%B%%B%%B%%B%%B%%B%%L% %B%%B%%B%%B% %D%%B%%B%%B% "
set "l28= %D%%B%%B%%B%%B%%B%%B%%B%%B%%B%%B%"
(echo()
for /l %%# in (1=1=8) do (
rem !l1%%#! - !l2%%#!
call :color F0 "!l1%%#!"
call :color FC "!l2%%#!" \n
)
(echo()
call mshta "javascript:code(close((V=(v=new ActiveXObject('SAPI.SpVoice')).GetVoices())&&v.Speak('athlon')))"
endlocal
::for /f "tokens=2" %%# in ("%cmdcmdline%") do if /i "%%#" equ "/c" runas /user:# "" 1>nul 2>&1
runas /user:# "" 1>nul 2>&1
Exit /B %errorlevel%
:Color
:: http://www.dostips.com/forum/viewtopic.php?p=41155#p41155
:: v23c
:: Arguments: hexColor text [\n] ...
:: \n -> newline ... -> repeat
:: Supported in windows XP, 7, 8.
:: This version works using Cmd /U
:: In XP extended ascii characters are printed as dots.
:: For print quotes, use empty text.
SetLocal EnableExtensions EnableDelayedExpansion
Subst `: "!Temp!" >Nul &`: &Cd \
SetLocal DisableDelayedExpansion
Echo(|(Pause >Nul &Findstr "^" >`)
Cmd /A /D /C Set /P "=." >>` <Nul
For /F %%# In (
'"Prompt $H &For %%_ In (_) Do Rem"') Do (
Cmd /A /D /C Set /P "=%%# %%#" <Nul >`.1
Copy /Y `.1 /B + `.1 /B + `.1 /B `.3 /B >Nul
Copy /Y `.1 /B + `.1 /B + `.3 /B `.5 /B >Nul
Copy /Y `.1 /B + `.1 /B + `.5 /B `.7 /B >Nul
)
:__Color
Set "Text=%~2"
If Not Defined Text (Set Text=^")
SetLocal EnableDelayedExpansion
For %%_ In ("&" "|" ">" "<"
) Do Set "Text=!Text:%%~_=^%%~_!"
Set /P "LF=" <` &Set "LF=!LF:~0,1!"
For %%# in ("!LF!") Do For %%_ In (
\ / :) Do Set "Text=!Text:%%_=%%~#%%_%%~#!"
For /F delims^=^ eol^= %%# in ("!Text!") Do (
If #==#! EndLocal
If \==%%# (Findstr /A:%~1 . \` Nul
Type `.3) Else If /==%%# (Findstr /A:%~1 . /.\` Nul
Type `.5) Else (Cmd /A /D /C Echo %%#\..\`>`.dat
Findstr /F:`.dat /A:%~1 .
Type `.7))
If "\n"=="%~3" (Shift
Echo()
Shift
Shift
If ""=="%~1" Del ` `.1 `.3 `.5 `.7 `.dat &Goto :Eof
Goto :__Color
goto :eof
:hexPrint string [rtnVar]
setlocal disableDelayedExpansion
for /f eol^=^%LF%%LF%^ delims^= %%A in (
'forfiles /p "%~dp0." /m "%~nx0" /c "cmd /c echo(%~1"'
) do (if "%~2" neq "" (endlocal&set %~2=%%A) else (endlocal&echo(%%A))
goto :eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment