저는 Windows 7을 사용하고 있는데, 이런 특수 문자를 사용하여 메뉴, 진행률 표시줄 등을 만들고 싶습니다. 어떻게 해야 하나요?
답변1
요점은 UTF-8 형식을 사용해야 한다는 것입니다.구경하다:
1단계] "UTF 8" 형식으로 새 CMD 스크립트를 만듭니다. (PsPad 또는 Notepad++ 편집자가 이 작업을 수행할 수 있습니다)
2단계] 첫 번째 줄에는 빈 줄을 남겨둡니다. UTF 8 헤더가 여기에 저장됩니다.
3단계] 아래 코드를 복사하여 붙여넣으세요.
@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%)
)
4단계] SET BKSPC= (에 80x 백스페이스 ASCII 문자를 "삽입"해야 합니다.http://columbia.edu/kermit/ascii.html)
5단계] CMD 콘솔 글꼴을 래스터가 아닌 트루타입 글꼴로 설정했는지 확인하세요.