Der Punkt ist - Sie müssen das UTF-8-Format verwenden, werfen Sie einen Blick darauf :
Schritt 1] Erstellen Sie ein neues CMD-Skript im "UTF 8" -Format. (PsPad- oder Notepad ++ - Editoren können dies tun)
Schritt 2] Lassen Sie in der ersten Zeile eine leere Leerzeile. Der UTF 8-Header wird dort gespeichert.
Schritt 3] Kopieren Sie den folgenden Code und fügen Sie ihn ein:
@echo off
CHCP 65001
:: *****************************************************************************
:: * Author: Gustaaf von Pickartz. *
:: * Date Created: 22nd July, 2012. *
:: * ------------------------------------------------------------------------- *
:: * This program is provided as is and for fair use distribution. *
:: * Give credit where credit is due to the author in your own script. *
:: * ------------------------------------------------------------------------- *
:: *****************************************************************************
SETLOCAL ENABLEDELAYEDEXPANSION
:: Progress Bar
SET PRG0=[░░░░░░░░░░]
SET PRG1=[▓░░░░░░░░░]
SET PRG2=[▓▓░░░░░░░░]
SET PRG3=[▓▓▓░░░░░░░]
SET PRG4=[▓▓▓▓░░░░░░]
SET PRG5=[▓▓▓▓▓░░░░░]
SET PRG6=[▓▓▓▓▓▓░░░░]
SET PRG7=[▓▓▓▓▓▓▓░░░]
SET PRG8=[▓▓▓▓▓▓▓▓░░]
SET PRG9=[▓▓▓▓▓▓▓▓▓░]
SET PRG10=[▓▓▓▓▓▓▓▓▓▓]
:: Star
SET STR1=/
SET STR2=--
SET STR3=\
SET STR4=^|
:: Please note there are special ASCII insertions in the SET BKSPC= declaration below. 80x backspace characters are inserted. ASCII Value 08=[BS]
:: Be sure to verify they are still there when you cut and paste from the web with your text editor (Notepad++ or PsPad). Insert them if missing, otherwise this script will not work...
SET BKSPC=
:Begin_Main
echo.
echo.
Echo Simple Animated star.
FOR /L %%I IN (1,1,400) DO (
<NUL (SET/P Z= PROGRESS: │)
<NUL (SET/P Z=%BKSPC%)
<NUL (SET/P Z= PROGRESS: /)
<NUL (SET/P Z=%BKSPC%)
<NUL (SET/P Z= PROGRESS: ─)
<NUL (SET/P Z=%BKSPC%)
<NUL (SET/P Z= PROGRESS: \)
<NUL (SET/P Z=%BKSPC%)
)
echo.
echo.
Echo Simple Progress bar indicator
FOR /L %%I IN (0,1,10) DO (
IF %%I LEQ 9 (SET TIC=0%%I) ELSE (SET TIC=%%I)
<NUL (SET/P Z=[!TIC!/10] PROGRESS: !PRG%%I!)
>NUL PING -n 2 localhost
<NUL (SET/P Z=%BKSPC%)
)
echo.
echo.
Echo Combined Progress bar and animated star...
FOR /L %%I IN (0,1,10) DO (
IF %%I LEQ 9 (SET TIC=0%%I) ELSE (SET TIC=%%I)
<NUL (SET/P Z=[!TIC!/10] PROGRESS: !PRG%%I!)
<NUL (SET/P Z=%BKSPC%)
FOR /L %%J IN (1,1,400) DO (
<NUL (SET/P Z=[!TIC!/10] PROGRESS: !PRG%%I! │)
<NUL (SET/P Z=%BKSPC%)
<NUL (SET/P Z=[!TIC!/10] PROGRESS: !PRG%%I! /)
<NUL (SET/P Z=%BKSPC%)
<NUL (SET/P Z=[!TIC!/10] PROGRESS: !PRG%%I! ─)
<NUL (SET/P Z=%BKSPC%)
<NUL (SET/P Z=[!TIC!/10] PROGRESS: !PRG%%I! \)
<NUL (SET/P Z=%BKSPC%)
)
<NUL (SET/P Z=%BKSPC%)
)
Schritt 4] Achten Sie darauf, 80x Backspace-ASCII-Zeichen im SET BKSPC einzufügen = ( http://columbia.edu/kermit/ascii.html )
Schritt 5] Stellen Sie sicher, dass Sie als Schriftart für die CMD-Konsole die True Type-Schriftart und nicht das Raster festlegen.