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-06-22 17:14
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Simulate a funny boot screen with batch processing View 15,537 Replies 52
Floor 16 Posted 2006-05-16 19:53 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline

There is also the forum moderator. Why does the following code only display b%% instead of 123? Can variables not be nested?
CODE:
--------------------------------------------------------------------------------

set a=123456789
set b=3
echo %a:~0,%b%%


This is why you need to use setlocal ENABLEDELAYEDEXPANSION to enable delayed environment variables. Of course, it doesn't mean that you can't achieve variable nesting without enabling delayed environment variables. For example, you can convert it by superimposing display commands:
echo %a:~0,^%b%^% | findstr .
Floor 17 Posted 2006-05-16 20:45 ·  中国 上海 华为云
中级用户
★★
Credits 256
Posts 93
Joined 2006-03-26 22:12
20-year member
UID 52853
Gender Male
From 广东
Status Offline
Thanks
Floor 18 Posted 2006-05-17 11:23 ·  中国 北京 顺义区 联通
银牌会员
★★★
DOS联盟捡破烂的
Credits 1,144
Posts 425
Joined 2005-10-20 00:00
20-year member
UID 43784
From 北京
Status Offline
The delay uses the code of brother 3742668, but I think the effect is not very good
@echo off
setlocal enabledelayedexpansion
set /a b=81
set a=">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>================================================================================"


:back
cls
for /l %%i in (1,1,20) do @echo.
echo Loading Windows 2000...
set /a b-=1
echo !a:~%b%,80!
if !b! == 1 goto :eof
call :delay 80
goto back


:delay
set /a num=num + 1
if %num% geq %1 (set num=) && goto :eof
goto delay
Floor 19 Posted 2006-07-24 16:25 ·  中国 山西 运城 电信
中级用户
★★
Credits 241
Posts 131
Joined 2005-09-28 19:01
20-year member
UID 42920
Gender Male
Status Offline
Another
1.jpg is the result with @echo off!

2.jpg is the result without @echo off!

Originally, it's a winxp sp1 system! :o
Attachments
1.JPG
2.JPG
房东说:这娃是个好孩子!
Floor 20 Posted 2006-07-26 02:59 ·  中国 山西 运城 移动
中级用户
★★
Credits 241
Posts 131
Joined 2005-09-28 19:01
20-year member
UID 42920
Gender Male
Status Offline
Now testing under the SP2 environment, the situation remains the same!
房东说:这娃是个好孩子!
Floor 21 Posted 2006-07-27 05:22 ·  中国 广东 中山 广东瑞江科技有限公司BGP数据中心
中级用户
★★
Credits 384
Posts 189
Joined 2005-10-19 13:12
20-year member
UID 43709
Gender Male
Status Offline
Attachments
111.JPG
Floor 22 Posted 2006-10-02 03:49 ·  中国 山东 淄博 联通
中级用户
★★
Credits 272
Posts 99
Joined 2006-06-02 09:12
20-year member
UID 56414
Status Offline
Based on the discussions of the诸位 above, I'll give a summary speech. The batch processing is as follows:


@echo off
setlocal EnableDelayedExpansion

set _tmp_F_S=C:\_delay.vbs
set _tmp_F_F=C:\_tmp.tmp
set delay=50
set s1=Booting
set s2=Booting fast
set s3=Damn it, booting
set s4=Are you going to boot or not, you bastard
set s5=Damn it!! If you don't boot again, I'll smash you!!
echo if WScript.Arguments.count = 1 then WScript.Sleep CInt(WScript.Arguments(0)) end if>%_tmp_F_S%
if exist %_tmp_F_F% del %_tmp_F_F%
for /L %%i in (1,1,4) do (call :show %%s%%i%% && call :fail %%s%%i%%)
call :show %s5%
call :suc
if exist %_tmp_F_S% del %_tmp_F_S%
if exist %_tmp_F_F% del %_tmp_F_F%
ping -n 1 127.1>nul
goto :EOF

:show
if "%~1"=="" goto :EOF
set s=%1
set /p ans=%cd%^><nul
set /A len=0
:comp_len
echo %%s:~%len%,1%% | find "ECHO">nul && goto end_comp
set /A "len+=1"
goto comp_len
:end_comp
set /A "len-=1"
for /L %%i in (0,1,%len%) do (cscript //nologo %_tmp_F_S% %delay% && set /p ans=!s:~%%i,1!<nul)
cscript //nologo %_tmp_F_S% 500
echo.
echo %cd%^>%1>>%_tmp_F_F%
echo.>>%_tmp_F_F%
goto :EOF

:fail
echo '%1' is not an internal or external command, nor a runnable program
or batch file.
echo '%1' is not an internal or external command, nor a runnable program>>%_tmp_F_F%
or batch file.>>%_tmp_F_F%
echo.>>%_tmp_F_F%
goto :EOF

:suc
ping -n 1 127.1>nul
set eqq================================================================================
set gtr=^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>^>
echo Loading Windows 2000 ...>>%_tmp_F_F%
echo.>>%_tmp_F_F%
for /L %%i in (0,1,79) do (set /A new=2*%%i && type %_tmp_F_F% && echo !gtr:~0,%%i!!eqq:~%%i,80! && ping -n 1 127.1>nul && cls)
goto :EOF
Floor 23 Posted 2006-10-03 09:08 ·  中国 广东 广州 电信
新手上路
Credits 10
Posts 3
Joined 2006-10-03 07:39
19-year member
UID 64393
Status Offline
Originally posted by my3439955 at 2006-10-2 03:49:
Based on the discussions of the诸位 above
I will give a summary speech
The batch processing is as follows


@echo off
setlocal EnableDelayedExpansion

set _tmp_F_S=C:\_delay.vbs
set _tmp_F_F=C:\_tmp.tmp
set delay ...


The lines are in order / but in the end it will keep repeating the previous content
Floor 24 Posted 2006-10-05 22:28 ·  中国 山东 淄博 联通
中级用户
★★
Credits 272
Posts 99
Joined 2006-06-02 09:12
20-year member
UID 56414
Status Offline
I don't understand what the person above means. Is it saying the screen flickering at the end?
Floor 25 Posted 2006-10-08 23:43 ·  中国 湖北 武汉 电信
初级用户
Credits 118
Posts 34
Joined 2006-01-10 09:01
20-year member
UID 48727
Status Offline
```batch
@echo off
color 1f
title.
mode con lines=10
rem Progress bar ▉▉▉▉▉
set work=0
set n=0
set mo=0
set number=0
rem all is the total number
set all=60
set time=%all%
:show

:check
if %number% GTR %mo% set num=%num%▉&set /a mo=%mo%+1&goto check

:2

cls
echo Progress: %n% / %all% Remaining time: %time% seconds
echo.
echo.
echo Completed %work% %%%
echo.
if not "%num%"=="" echo %num%
if not "%num%"=="" echo %num%

if %work%==100 goto end

ping 127.1 -n 3 >nul
set /a n=%n%+1
set /a time=%all%-%n%
set /a work=(%n%)*100/(%all%)
set /a number=%work%/3
set /a number=%number%+1
goto show
endlocal

:end
endlocal
pause>nul
```
Floor 26 Posted 2006-10-09 01:01 ·  中国 浙江 衢州 电信
银牌会员
★★★
Credits 1,270
Posts 548
Joined 2004-05-31 00:00
22-year member
UID 25754
Gender Male
Status Offline
It's very interesting. I tried it and it really works.
Floor 27 Posted 2006-10-09 10:42 ·  中国 广西 柳州 电信
初级用户
Credits 44
Posts 18
Joined 2006-10-09 09:30
19-year member
UID 65057
Status Offline
So wonderful!!!
Floor 28 Posted 2006-10-09 21:51 ·  中国 甘肃 兰州 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Originally posted by bg at 2006-10-8 23:43:
@echo off
color 1f
title.
mode con lines=10
rem Progress bar ▉▉▉▉▉
set work=0
set n=0
set mo=0
set number=0
rem all is the total number
set all=60
set time=%all%
:show

:check
if %num ...

Nice~ Just what I was looking for
Floor 29 Posted 2006-11-04 11:46 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
http://forum.dirshell.com/read.php?tid=1309&keyword=

There are traitors. Drag them out and shoot them.

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 30 Posted 2006-11-05 05:39 ·  中国 甘肃 甘南藏族自治州 合作市 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Just, dizzy, copy without writing the source, BS
Forum Jump: