How to multitask batch programs?

November 19, 2010 at 07:56:37
Specs: Windows XP
My code is here:
@echo off
Title Platfrom Beta 2.7 Download
COLOR 0A
:choice
set /P c=Are you sure you want to download 'Platfrom Beta 2.7 Download'[Y/N]?
if /I "%c%" EQU "Y" goto :Download
if /I "%c%" EQU "N" goto :choice2
goto :wrong key

:wrong key
echo You did not type Y or N. Please try again...
ping localhost -n 2 >nul
cls
set /P c=Are you sure you want to download 'Platfrom Beta 2.7 Download'[Y/N]?
if /I "%c%" EQU "Y" goto :Download
if /I "%c%" EQU "N" goto :choice2
goto :wrong key

:Download
echo Please wait while 'Platform Game Beta 2.7' is being installed to your computer.
ping localhost -n 3 >nul
@CLS
echo Loading... Please Wait
echo ---------------------------------------
echo = 0 ]
echo ---------------------------------------
ping localhost -n 1.5 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading. Please Wait
echo ---------------------------------------
echo [] = 5 ]
echo ---------------------------------------
ping localhost -n 4 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading.. Please Wait
echo ---------------------------------------
echo [][] = 15 ]
echo ---------------------------------------
ping localhost -n 1.5 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading... Please Wait
echo ---------------------------------------
echo [][][] = 23 ]
echo ---------------------------------------
ping localhost -n 1.5 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading. Please Wait
echo ---------------------------------------
echo [][][][] = 30 ]
echo ---------------------------------------
ping localhost -n 2 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading.. Please Wait
echo ---------------------------------------
echo [][][][][] = 38 ]
echo ---------------------------------------
ping localhost -n 3 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading... Please Wait
echo ---------------------------------------
echo [][][][][] = 42 ]
echo ---------------------------------------
ping localhost -n 2 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading. Please Wait
echo ---------------------------------------
echo [][][][][][] = 45 ]
echo ---------------------------------------
ping localhost -n 1 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading.. Please Wait
echo ---------------------------------------
echo [][][][][][][] = 48 ]
echo ---------------------------------------
ping localhost -n 2 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading... Please Wait
echo ---------------------------------------
echo [][][][][][][][] = 50 ]
echo ---------------------------------------
ping localhost -n 3 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading. Please Wait
echo ---------------------------------------
echo [][][][][][][][][] = 56 ]
echo ---------------------------------------
ping localhost -n 2 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading.. Please Wait
echo ---------------------------------------
echo [][][][][][][][][][] = 63 ]
echo ---------------------------------------
ping localhost -n 1 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading... Please Wait
echo ---------------------------------------
echo [][][][][][][][][][][] = 69 ]
echo ---------------------------------------
ping localhost -n 3 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading. Please Wait
echo ---------------------------------------
echo [][][][][][][][][][][][] = 75 ]
echo ---------------------------------------
ping localhost -n 1.5 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading.. Please Wait
echo ---------------------------------------
echo [][][][][][][][][][][][][] = 79 ]
echo ---------------------------------------
ping localhost -n 1.5 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading... Please Wait
echo ---------------------------------------
echo [][][][][][][][][][][][][][] = 86 ]
echo ---------------------------------------
ping localhost -n 5 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading. Please Wait
echo ---------------------------------------
echo [][][][][][][][][][][][][][][] = 90 ]
echo ---------------------------------------
ping localhost -n 2 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading.. Please Wait
echo ---------------------------------------
echo [][][][][][][][][][][][][][][] = 96 ]
echo ---------------------------------------
ping localhost -n 1.5 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading... Complete!
echo ---------------------------------------
echo [][][][][][][][][][][][][][][][]= 100 ]
echo ---------------------------------------
ping localhost -n 3 >nul
mkdir "\Platform Game Beta 2.7"
echo Status: Complete
echo Platform Game Beta 2.7 is now installed to your computer.
ping localhost -n 3 >nul

:Start?
set /P c=Would you like to open the folder[Y/N]?
if /I "%c%" EQU "Y" goto :Open
if /I "%c%" EQU "N" goto :choice3
goto :wrong key?

:wrong key?
echo You did not type Y or N. Please try again...
ping localhost -n 2 >nul
cls
set /P c=Would you like to open the folder[Y/N]?
if /I "%c%" EQU "Y" goto :Open
if /I "%c%" EQU "N" goto :choice3
goto :wrong key

:Open
start "\Platform Game Beta 2.7"
echo Thank you for downloading Platform Beta 2.7. Have a nice day!
ping localhost -n 5 >nul
exit

:choice2
set /P c=Are you sure you want to leave[Y/N]? (You won't be able to download the game.)
if /I "%c%" EQU "Y" goto :exit
if /I "%c%" EQU "N" goto :choice
goto :wrong key2

:wrong key2
echo You did not type Y or N. Please try again...
ping localhost -n 2 >nul
cls
set /P c=Are you sure you want to leave[Y/N]? (You won't be able to download the game.)
if /I "%c%" EQU "Y" goto :exit
if /I "%c%" EQU "N" goto :choice
goto :wrong key

:choice3
set /P c=Are you sure you want to leave[Y/N]?
if /I "%c%" EQU "Y" goto :exit
if /I "%c%" EQU "N" goto :Start?
goto :wrong key3

:wrong key3
echo You did not type Y or N. Please try again...
ping localhost -n 2 >nul
cls
set /P c=Are you sure you want to leave[Y/N]?
if /I "%c%" EQU "Y" goto :exit
if /I "%c%" EQU "N" goto :Start?
goto :wrong key

pause
:exit
echo Good bye!
pause
exit

The only problem is that the loading... won't go smoothly because I made the time different e.g.:
ping localhost -n 2 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading.. Please Wait
echo ---------------------------------------
echo [][][][][][][][][][][][][][][] = 96 ]
echo ---------------------------------------
ping localhost -n 1.5 >nul
cls
echo loading 'Platform Beta 2.7'...
echo Loading... Complete!
echo ---------------------------------------
echo [][][][][][][][][][][][][][][][]= 100 ]
echo ---------------------------------------
The loading bar(loading. loading.. loading... loading. so on...)won't go at an even pace. Is there anyway to multitask those, or can you post a code with it going smoothly, with the bar going at different paces?


See More: How to multitask batch programs?

Report •


#1
November 19, 2010 at 07:59:09
This is horrible UI design. If the progress bar means nothing, don't include one.

How To Ask Questions The Smart Way


Report •

#2
November 19, 2010 at 08:04:21
I really wanted the bar, I just want to know what I asked for.

Report •

Related Solutions


Ask Question