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-01 13:23
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » The Christmas card batch file I wrote casually, please前辈give guidance View 4,898 Replies 15
Original Poster Posted 2010-12-14 18:45 ·  中国 广东 东莞 电信
初级用户
Credits 23
Posts 13
Joined 2009-06-02 07:33
17-year member
UID 146527
Gender Male
Status Offline
@echo off
title Christmas Card
color 02

echo.
echo.
echo Do you want to give an electronic Christmas card to your TA? Just follow the prompts below.
echo.
pause
cls

set /p name=Enter your TA's name (press Enter to continue):
set /p one=Enter the first sentence you want to say to them, up to 25 characters (press Enter to continue):
set /p two=Enter the second sentence you want to say to them, up to 25 characters (press Enter to continue):
set /p three=Enter the second sentence you want to say to them, up to 25 characters (press Enter to continue):
set /p you=Enter your name (press Enter to continue):

set one=%one:~0,25%
set two=%two:~0,25%
set three=%three:~0,25%

set a=10
set b=5
set c=0

:m
set /a a+=7
set /a b+=2
set /a c+=1
if %c% gtr 9 set c=0
color 0%c%

echo.
echo ·
echo · ☆ ·
echo · ☆△☆
echo · ◇※※◇ · ·
echo · △△※△△
echo · ★※☆★※★☆ ·
echo △
echo · ☆※☆ ·
echo ◆◇●◎ ·
echo · △※▲※★ ·
echo ※☆◇◇☆※
echo · △△△△△△△△△
echo · ■ ·
echo · ■ ·
echo · ■ ·
echo ----------------------------------------------------------------------------------------------
echo · · · · Wish you · · · ·
echo · · · · · · · ·
echo · · · · · ·
echo · · · ·
echo · Christmas · · Happy ·
echo · · · ·
echo · · · ·
echo · · · ·
echo · · · ·
echo · ·

mode con cols=%a% lines=%b%
if %a% lss 90 goto m

echo.
echo ·
echo · ☆ ·
echo · ☆△☆
echo · ◇※※◇ · · TO:%name%
echo · △△※△△ %one%
echo · ★※☆★※★☆ · %two%
echo △ %three%
echo · ☆※☆ ·
echo ◆◇●◎ ·
echo · △※▲※★ ·
echo ※☆◇◇☆※
echo · △△△△△△△△△
echo · ■ · By:%you%
echo · ■ ·
echo · ■ ·
echo ----------------------------------------------------------------------------------------------
echo · · · · Wish you · · · ·
echo · · · · · · · ·
echo · · · · · ·
echo · · · ·
echo · Christmas · · Happy ·
echo · · · ·
echo · · · ·
echo · · · ·
echo · · · ·
echo · ·

for %%i in (01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f) do (ping 127.0.0.1 -n 2 > nul & color %%i)

echo Is the preview done? Press any key to exit! & pause >nul

echo @echo off >> temp.txt
echo title Merry Christmas >> temp.txt
echo set one=%one% >> temp.txt
echo set two=%two% >> temp.txt
echo set three=%three% >> temp.txt
echo set you=%you% >> temp.txt

for /f "skip=17 tokens=*" %%i in ('type %0') do echo %%i >> temp.txt

for /f "skip=2 tokens=*" %%i in ('find /v /i "temp" temp.txt') do echo %%i >>temp1.txt
for /f "skip=2 tokens=*" %%i in ('find /v /i "explorer" temp1.txt') do echo %%i >>temp2.txt
for /f "skip=2 tokens=*" %%i in ('find /v /i "ta" temp2.txt') do echo %%i >> 圣诞卡片.bat

del temp.txt
del temp1.txt
del temp2.txt

echo The card has been saved in %~d0%~p0, you can send it to your TA. Press any key to exit. & pause > nul
start explorer %~d0%~p0

:s
set /a a-=7
set /a b-=2
mode con cols=%a% lines=%b%
if %a% gtr 10 (goto s) else (exit)
我不是人
Floor 2 Posted 2010-12-15 12:12 ·  中国 北京 联通
高级用户
★★★
据说是李先生
Credits 609
Posts 400
Joined 2008-04-23 15:55
18-year member
UID 116706
Gender Male
Status Offline
It's quite thoughtful. There are also entry and exit effects, which are very user-friendly things. I believe with such a mindset, you will definitely be able to make more perfect things.

One point, %~d0%~p0 is actually the same as %~pd0 and %~dp0. I feel that if the things in the following posts are applied, it might be better:

Single-line output of colored characters
http://cn-dos.net/forum/viewthread.php?tid=38940
Command parameters of explorer.exe and their applications
http://cn-dos.net/forum/viewthread.php?tid=28256
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
lzbow +2 2011-01-02 13:50
Floor 3 Posted 2010-12-16 15:10 ·  中国 广东 东莞 电信
银牌会员
★★★
批处理编程迷
Credits 1,916
Posts 752
Joined 2008-12-28 04:30
17-year member
UID 135147
Gender Male
From 广西
Status Offline
I also write one.
Use the building block of the landlord,
But colorful,
The stars will twinkle~~~
The file is also word by word color changing~~~
There are also mouse effects~~~
The star following the mouse will also change color~~Hehe~~
What if the screen is garbled after moving the mouse too much? It doesn't matter! After the text is made word by word, it will automatically refresh~~~
The most important point, the CPU usage rate is below %1!!!

[ Last edited by netbenton on 2010-12-16 at 01:03 ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
lzbow +2 2011-01-02 13:51
Attachments
2010圣诞贺卡.rar (3.13 KiB, Downloads: 70)
精简
=> 个人网志
Floor 4 Posted 2010-12-16 17:57 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
Originally posted by netbenton at 2010-12-16 15:10:
I'll write one too

Using the LZ's picture,
But colorful,
The stars will twinkle~~~

Be careful~~~ It's a bomb, press any key to explode...
Floor 5 Posted 2010-12-16 21:07 ·  中国 广东 东莞 电信
银牌会员
★★★
批处理编程迷
Credits 1,916
Posts 752
Joined 2008-12-28 04:30
17-year member
UID 135147
Gender Male
From 广西
Status Offline
It is said to be a bomb, which is used to scare MM, haha~~~

Just added a lot of functions, and it can be played like this in the cmd window~~~~~~~...

The attachment on the 3rd floor has been updated.

Special reminder:

This ts.com can also realize these special effect functions under pure DOS!!!
精简
=> 个人网志
Floor 6 Posted 2010-12-16 21:14 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
There is some garbled code pointed out to you...
Attachments
未命名.gif
Floor 7 Posted 2010-12-16 21:39 ·  中国 广东 东莞 电信
银牌会员
★★★
批处理编程迷
Credits 1,916
Posts 752
Joined 2008-12-28 04:30
17-year member
UID 135147
Gender Male
From 广西
Status Offline
Hanyeguxing

It seems your computer is more compatible with mine.
Many netizens said they couldn't see the effect when running it,
and don't know what the reason is?
精简
=> 个人网志
Floor 8 Posted 2010-12-16 22:50 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
Everything that can't be seen is all RPWT......
Floor 9 Posted 2010-12-17 21:58 ·  中国 广东 东莞 电信
银牌会员
★★★
批处理编程迷
Credits 1,916
Posts 752
Joined 2008-12-28 04:30
17-year member
UID 135147
Gender Male
From 广西
Status Offline
Write another special effect under pure DOS, in Windows just try the third floor.

Set the environment variable space larger:

command /E:4096

Use Tianhui or UCDOS Chinese display system
Attachments
纯dos下的批处理特效显示.rar (3.13 KiB, Credits to download 1 pts, Downloads: 16)
精简
=> 个人网志
Floor 10 Posted 2010-12-23 09:46 ·  中国 电信
新手上路
Credits 5
Posts 3
Joined 2009-07-01 03:16
17-year member
UID 148475
Gender Male
Status Offline
There is no garbled code here, and the effect is achieved, which is quite beautiful.
Floor 11 Posted 2010-12-24 15:28 ·  中国 四川 成都 电信
新手上路
Credits 13
Posts 7
Joined 2008-03-09 16:10
18-year member
UID 112473
Gender Male
Status Offline
What is ts.com? Is it scary because of this?!
Floor 12 Posted 2010-12-27 17:55 ·  中国 广东 东莞 中移铁通
初级用户
★★
Credits 115
Posts 92
Joined 2010-12-24 16:57
15-year member
UID 179794
Gender Male
Status Offline
Floor 13 Posted 2010-12-27 19:49 ·  中国 广东 东莞 电信
银牌会员
★★★
批处理编程迷
Credits 1,916
Posts 752
Joined 2008-12-28 04:30
17-year member
UID 135147
Gender Male
From 广西
Status Offline
Further enhancement:

Implemented to display colorful stars according to the mouse movement trajectory and gradually disappear.
Attachments
2010圣诞贺卡.rar (3.45 KiB, Credits to download 1 pts, Downloads: 7)
精简
=> 个人网志
Floor 14 Posted 2011-01-17 10:14 ·  中国 吉林 长春 电信
初级用户
枫中残雪
Credits 65
Posts 43
Joined 2010-04-29 23:20
16-year member
UID 165810
Gender Male
From 吉林省长春市
Status Offline
The idea is very good, the conception is wonderful, learned
Floor 15 Posted 2011-01-18 19:52 ·  中国 广东 东莞 中移铁通
初级用户
★★
Credits 115
Posts 92
Joined 2010-12-24 16:57
15-year member
UID 179794
Gender Male
Status Offline
It is suggested to add music effects to make it better.
Forum Jump: