This code:
@echo off
set /p a=Installing [<nul
set b=1
:loop
if %b% leq 2 set /p a=°<nul
if %b% gtr 4 if %b% leq 6 set /p a=±<nul
if %b% gtr 6 if %b% leq 8 set /p a=²<nul
if %b% gtr 8 if %b% leq 10 set /p a=±<nul
if %b% gtr 10 set /p a=°<nul
choice /t 1 /c y /d y>nul
set /a b=%b%+1
if %b%==13 (echo ]&goto :eof)
goto :loop
... came from http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_1237-DOS-ECHO-text-to-previous-line-by-Paul-Tomasi.html#c18182 and produces the below output in a cmd window:
Installing [░░▒▒▓▓▒▒░░]
However, I cant seem to find an explanation through google as to how this works. Substituting other extended ascii characters into their place seems to produce "The syntax of the command is incorrect", so have only managed to guess that this is a hack whereby something exchanges these characters to lower characters in the extended ascii set, by way of unintended-by-the-designers trick.
If anyone could also suggest a good website for learning more about cmd / cmd programs' features like this, it would be appreciated.
It's because your editor uses a different encoding from the one DOS and the command line use.
See characters 176-178 here:
http://academic.evergreen.edu/projects/biophysics/technotes/program/ascii_ext-pc.htm
Character pairs in columns DOS and WIN are represented by the same numerical values, but DOS (and hence the command line) and Windows (your text editor) display these numbers as different symbols.
In case it's not clear: your text file is a series of bytes (numbers) and one of these bytes has value 176. Under DOS code page 437 it used to denote ▓ glyph, and command line, for historical reasons, uses the same encoding as DOS did. But your text editor, running on Windows, apparently reads the file using the old Windows-1252 encoding, where 176 means °.
You could try to find an editor supporting 437, it would save you from such confusions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With