Using ASCII fonts and block elements for text messages - problem with encoding of BAT file
Posted: 11 Aug 2022 13:26
To some of my BAT scripts that I use I have inserted a fail-safe consisting of a countdown and a short text explaining what is about to happen. For example
[For test purposes I have removed from the above example the actual command for reset - i.e.: >> shutdown /r /f /t 0 <<]
The problem with such info is the normal thus small size of its letters in CMD window- when I click shortcuts to BAT like these I can hardly read them when I am laying on my bed. And so I wanted to use letters built from block elements like
But as doing this by hand was not a reasonable option for me I went to The Internets and found me websites like https://www.coolgenerator.com/ascii-text-generator and http://patorjk.com/software/taag/#p=dis ... mething%20 and tried out using some fonts. Unfortunately:
#1] some do work but I just do not like how they look [e.g. Banner3]
#2] some after execution of BAT file will only flash the CMD window doing nothing else [e.g. Cybermedium, Irvit]
#3] some after execution of BAT file will produce totally messed up blocks of gibberish signs not present in those fonts [e.g. Regular ANSI, ANSI Shadow]
#4] some after pasting into BAT file have letters messed up to some degree [e.g. Univers]
So to avert issues #3 and #4 I tried changing [in Notepad2 version 4.2.5] encoding of my test BAT file from UTF-8 to others. And I saw changes or no changes in how these fonts looked like - bu simply lack knowledge and experience in this area
And so my question are:
A] What encoding should I use to see signs used by such fonts in both the BAT file and in CMD in a proper way [i.e. the way the look on those websites]?
B] What are the proper encodings for BAT files in overall?
C] How is it possible that an >> echo << followed by some unusual signs apparently breaks a whole script?
D] Will PS1 files also behave [visually] in the same way [with the same encoding chosen for them]?
Code: Select all
@echo off
echo.
echo. Commencing system reset
echo.
echo. PRESS ANY KEY TO CANCEL
echo.
timeout /t 5 |findstr /r ".0$" && goto continue || exit
command > nul 2>&1
:continue
exit
The problem with such info is the normal thus small size of its letters in CMD window- when I click shortcuts to BAT like these I can hardly read them when I am laying on my bed. And so I wanted to use letters built from block elements like
Code: Select all
█
▮
▓
#1] some do work but I just do not like how they look [e.g. Banner3]
#2] some after execution of BAT file will only flash the CMD window doing nothing else [e.g. Cybermedium, Irvit]
#3] some after execution of BAT file will produce totally messed up blocks of gibberish signs not present in those fonts [e.g. Regular ANSI, ANSI Shadow]
#4] some after pasting into BAT file have letters messed up to some degree [e.g. Univers]
So to avert issues #3 and #4 I tried changing [in Notepad2 version 4.2.5] encoding of my test BAT file from UTF-8 to others. And I saw changes or no changes in how these fonts looked like - bu simply lack knowledge and experience in this area
And so my question are:
A] What encoding should I use to see signs used by such fonts in both the BAT file and in CMD in a proper way [i.e. the way the look on those websites]?
B] What are the proper encodings for BAT files in overall?
C] How is it possible that an >> echo << followed by some unusual signs apparently breaks a whole script?
D] Will PS1 files also behave [visually] in the same way [with the same encoding chosen for them]?