China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-11 23:04
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Display a String Character by Character View 786 Replies 0
Original Poster Posted 2010-08-16 14:38 ·  中国 江西 南昌 电信
初级用户
Credits 38
Posts 21
Joined 2010-02-21 18:11
16-year member
UID 160939
Gender Male
From 南昌
Status Offline
Display a string character by character:

@echo off
setlocal EnableDelayedExpansion
set a=1234567890abcdefghijklmnopqrstuvwxyz
for /l %%i in (0 1 35) do (
set /p=!a:~%%i,1!<nul
ping -n 2 127.0.1>nul
)
echo.
pause
Function: displays 1234567890abcdefghijklmnopqrstuvwxyz one character at a time, with a 1-second interval between every two letters. It also works for Chinese characters.
==================================================
Note: the n in for /l %%i in (0 1 n) do (......) is the number of characters to displayminus 1
No need to explain ping -n 2 127.0.1, it's for delay. The time can be adjusted.
==================================================
Everyone can copy it into your own batch files to make them look nicer!

And don't forget to reply!
Forum Jump: