Pretty batch processing progress bar effect code

Source: Internet
Author: User

Copy codeThe Code is as follows: @ echo off
Mode con cols = 113 lines = 15 & color 9f
: Starthome
Cls
Set a = ^ set/p = ■ % B % ^ <nul ^ & ping/n 0 127.1 ^> nul ^ &
Echo.
Echo program initializing...
Echo.
Echo ┌ ── ─
Set/p = <nul & % a % % a % a %
Echo 100% %
Echo └ ── ─

Set B =
Set a = ■
Set/a z = 100
Pause
: Start
Cls
Set a = % a % ■
Set/a B + = 5
Set/a z-= 5
Echo.
@ Echo remaining progress % z %
@ Echo ┌ ── ─
@ Echo % a % B %
@ Echo └ ── ─
If % B % geq 100 goto num2
Ping/n 0 127.1> nul

Set/a sum = 5
Goto start

: _ Exit
Set/a sum-= 1
Set/p = % sum % seconds before exiting! <Nul
Echo.
If % sum % EQU 0 exit
Ping/n 2 127.1> nul
Goto _ exit

Rem rushed to half and then shrunk, rushed to half and added
: Num2
Setlocal EnableDelayedexpansion
Set sum =
Set z =
Set a = ■ ■
Set/a z1 = 52
Set/a z2 = 52
: Start2
Cls
Set sum52 =
Set/a z2 = 52
Set/a sum + = 1
Set/a z1-= 1
Set B =! A :~ % Sum %!
Set c =! A :~ -% Sum %!
Call: _ color
Echo.
Echo.
Remaining echo progress: % z1 %
Echo ┌ ── ─
Echo % B % z1 %
Echo └ ── ─
Echo current COLOR code: COLOR 0! Numca!
Echo.
Echo.
Echo current progress: % sum %
Echo ┌ ── ─
Echo % c % sum %
Echo └ ── ─
Echo current COLOR code: COLOR 0! Numca!
If % sum % geq 52 call: sum52
Ping/n 0 127.1> nul
Goto start2
: Sum52
Cls
Set sum =
Set/a z1 = 52
Set/a sum52 + = 1
Set/a z2-= 1
Set c =! A :~ % Sum52 %!
Set B =! A :~ -% Sum52 %!
Call: _ color
Echo.
Echo.
Echo current progress: % sum52 %
Echo ┌ ── ─
Echo % B % sum52 %
Echo └ ── ─
Echo current COLOR code: COLOR 0! Numca!
Echo.
Echo.
Remaining echo progress: % z2 %
Echo ┌ ── ─
Echo % c % z2 %
Echo └ ── ─
Echo current COLOR code: COLOR 0! Numca!
If % sum52 % geq 52 call: start2
Ping/n 0 127.1> nul
Cls
Goto sum52

: _ Color
Set _ color = 1234567890 ABCDEF
Set/a _ random = % random % 16
Set numca =! _ Color :~ % _ Random %, 1!
Color 0! Numca!
Goto: eof

Packaging provides download http://xiazai.jb51.net/201102/other/jindutiao_bat.rar to prevent code from errors in the editor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.