中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-23 14:09
47,812 topics / 349,917 posts / today 0 new / 48,273 members
DOS批处理 & 脚本技术(批处理室) » The Christmas card batch file I wrote casually, please前辈give guidance
Printable Version  5,359 / 15
Floor1 lzbow Posted 2010-12-14 18:45
初级用户 Posts 13 Credits 23
@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)
Floor2 qinchun36 Posted 2010-12-15 12:12
高级用户 Posts 400 Credits 609
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
Floor3 netbenton Posted 2010-12-16 15:10
银牌会员 Posts 752 Credits 1,916 From 广西
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 ]

Attachments
2010圣诞贺卡.rar (3.13 KiB)
Floor4 Hanyeguxing Posted 2010-12-16 17:57
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
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...
Floor5 netbenton Posted 2010-12-16 21:07
银牌会员 Posts 752 Credits 1,916 From 广西
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!!!
Floor6 Hanyeguxing Posted 2010-12-16 21:14
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
There is some garbled code pointed out to you...

Attachments
未命名.gif (14.15 KiB)
Floor7 netbenton Posted 2010-12-16 21:39
银牌会员 Posts 752 Credits 1,916 From 广西
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?
Floor8 Hanyeguxing Posted 2010-12-16 22:50
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
Everything that can't be seen is all RPWT......
Floor9 netbenton Posted 2010-12-17 21:58
银牌会员 Posts 752 Credits 1,916 From 广西
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)
Floor10 renmingwu Posted 2010-12-23 09:46
新手上路 Posts 3 Credits 5
There is no garbled code here, and the effect is achieved, which is quite beautiful.
Floor11 Gipors Posted 2010-12-24 15:28
新手上路 Posts 7 Credits 13
What is ts.com? Is it scary because of this?!
Floor12 acaigg Posted 2010-12-27 17:55
初级用户 Posts 92 Credits 115
Floor13 netbenton Posted 2010-12-27 19:49
银牌会员 Posts 752 Credits 1,916 From 广西
Further enhancement:

Implemented to display colorful stars according to the mouse movement trajectory and gradually disappear.

Attachments
2010圣诞贺卡.rar (3.45 KiB)
Floor14 726842270 Posted 2011-01-17 10:14
初级用户 Posts 43 Credits 65 From 吉林省长春市
The idea is very good, the conception is wonderful, learned
Floor15 acaigg Posted 2011-01-18 19:52
初级用户 Posts 92 Credits 115
It is suggested to add music effects to make it better.
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023