Batch Files

by PatrickM31 in Circuits > Computers

111 Views, 0 Favorites, 0 Comments

Batch Files

2.0 2.png
2.0.png
2.0 3.png

Please download this 2.0 version of my trivia! Thanks! Sorry, but im not giving access to the code i wrote. Please download all files including the Install Disk. The Program will ask for you to open it during startup.

Step 1 - @echo Off

First, you of course need to do

@echo off

so things you don't want wont pop up.

Step 2 : the Code

Copy this code, or copy it and make changes. (Please tell me is you do that, and give me credit in your batch file.

sorry about the spaces.

@echo off

color 0f

title PKM PORTAL

echo PKM PORTAL

echo.

echo LOADING REQUIRED FILES NEEDED FOR STARTUP. DO NOT CLOSE THIS WINDOW!

ping localhost -n 5 >nul

cls

echo PKM PORTAL

echo.

echo LOADING REQUIRED FILES NEEDED FOR STARTUP. DO NOT CLOSE THIS WINDOW!

echo .BAT FILES .CMD FILES AND ALL PROGRAM FILES LOADED.

ping localhost -n 5 >nul

cls

echo PLEASE OPEN ALL FILE DISK PACKAGES INCLUDED WHEN PROGRAM WAS DOWNLOADED.

pause

cls

echo DISK INSERTED.

echo.

echo STARTUP WILL NOW CONTINUE. DO NOT CLOSE THIS WINDOW.

ping localhost -n 7 >nul

cls

echo You will Now Start Your Downloaded Program By P@G, A TradeMark Of The Patrick Kendrick Maranon Association

echo.

echo WHILE STARTUP WILL CONTINUE, PLEASE DO NOT CLOSE THIS WINDOW, WHICH WILL STOP THE STARTUP AND COULD DAMAGE FILES.

ping localhost -n 9 >nul

cls

echo PLEASE CLOSE ALL FILE DISK PACKAGES OPEN TO CONTINUE.

ping localhost -n 5 >nul

@echo off

color 0f

title Patrick's Trivia Beta Update 2.0

:INTRO

echo BAT FILE OPENED.>RESULTS.txt

cls

echo Your game is loading. STARTING UP .BAT AND .CMD

echo Will load in: 5 seconds

ping localhost -n 2.5 >nul

cls

echo Your game is loading.

echo Will load in: 5 seconds

echo L

echo.

echo Loading .bat File

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 5 seconds

echo L O

echo.

echo Loading .bat File

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 5 seconds

echo L O A

echo.

echo Loading .bat File

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 5 seconds

echo L O A D

echo.

echo Loading .cmd File

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 4 seconds

echo L O A D I

echo.

echo Loading .cmd File

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 4 seconds

echo L O A D I N

echo.

echo Loading .cmd File

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 4 seconds

echo L O A D I N G

echo.

echo Loading .cmd File

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 4 seconds

echo L

echo.

echo Loading .cmd File

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 4 seconds

echo L O

echo Loading All Files

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 3 seconds

echo L O A

echo Loading All Files

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 3 seconds

echo L O A D

echo Loading All Files

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 3 seconds

echo L O A D I

echo Loading All Files

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 3 seconds

echo L O A D I N

echo Loading All Files

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 3 seconds

echo L O A D I N G

echo Loading All Files

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 2 seconds

echo Please Wait.

echo Starting Program

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 2 seconds

echo Please Wait.

echo starting Program

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 2 seconds

echo Please Wait.

echo starting Program

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 2 seconds

echo Please Wait.

echo starting Program

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 2 seconds

echo Please Wait.

echo starting Program

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 1 second

echo Please Wait.

echo starting Program

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 1 second

echo Please Wait.

echo starting Program

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 1 second

ping localhost -n 1.9 >nul

cls

echo Your game is loading.

echo Will load in: 1 second

ping localhost -n 2.3 >nul

@echo off

cls

color 84

title Patrick's Trivia Beta Update

echo __________________________

echo.

echo Starting Up Program.....

echo.

echo __________________________

ping localhost -n 2.4 >nul

echo.

cls

echo __________________________

echo.

echo Starting Up Program.....

echo.

echo __________________________

ping localhost -n 2.5 >nul

echo.

@echo off

cls

color 30

echo LOADING FILES

echo.

echo LOADING PATRICK'S TRIVIA BETA UPDATE 2.0.BAT

echo.

echo -------------------

echo FINISHING STARTUP

echo -------------------

echo.

ping localhost -n 7

echo.

@echo off

cls

color 0f

echo PROGRAM AND ALL FILES LOADED - PLEASE DO NOT EXIT THIS WINDOW.

ping localhost -n 3 > nul

cls

color 0f

echo PROGRAM AND ALL FILES LOADED - PLEASE DO NOT EXIT THIS WINDOW.

ping localhost -n 3 > nul

cls

color f0

echo W

ping localhost -n 2 > nul

cls

echo W

echo E

ping localhost -n 2 > nul

cls

echo W

echo E

echo L

ping localhost -n 2 > nul

cls

echo W

echo E

echo L

echo C

ping localhost -n 2 > nul

cls

echo W

echo E

echo L

echo C

ping localhost -n 2 > nul

cls

echo W

echo E

echo L

echo C

echo O

ping localhost -n 2 > nul

cls

echo W

echo E

echo L

echo C

echo O

echo M

ping localhost -n 2 > nul

cls

echo W

echo E

echo L

echo C

echo O

echo M

echo E

ping localhost -n 2 > nul

cls

echo W

ping localhost -n 1.8 > nul

cls

echo W

echo E

ping localhost -n 1.8 > nul

cls

echo W

echo E

echo L

ping localhost -n 1.8 > nul

cls

echo W

echo E

echo L

echo C

ping localhost -n 1.8 > nul

cls

echo W

echo E

echo L

echo C

ping localhost -n 1.8 > nul

cls

echo W

echo E

echo L

echo C

echo O

ping localhost -n 1.8 > nul

cls

echo W

echo E

echo L

echo C

echo O

echo M

ping localhost -n 1.8 > nul

cls

echo W

echo E

echo L

echo C

echo O

echo M

echo E

ping localhost -n 1.8 > nul

cls

echo.

echo.

echo.

echo.

echo.

echo.

echo W E L C O M E

ping localhost -n 2.5 > nul

cls

echo.

echo.

echo VERSION 2.0

echo.

echo.

echo.

echo W E L C O M E TO PATRICK'S TRIVIA

ping localhost -n 6 > nul

cls

color 90

:start

cls

color A2

echo.

echo _____________________________________

echo.

echo Welcome To Patrick's Trivia

echo.

echo _____________________________________

echo.

echo Please Sign in. To Continue, Type signin. To leave, type exit now.

echo.

set /p start=

if %start%== signin goto home

if %start%== exit exit

@echo off

:home

title Log On To Patrick's Trivia

color 07

cls

echo.

echo P@G Accounts

echo --------------

echo.

echo [1] Log In

echo [2] Sign Up

echo [3] Exit

echo.

set /p op=

if %op%==1 goto 1

if %op%==2 goto 2

if %op%==3 goto 3

goto error

:2

cls

echo Sign Up

echo ======================================

echo.

set /p newname="Enter new username:"

if "%newname%"=="%newname%" goto inputname

:inputname

cd "%userprofile%\documents"

if exist "cmdacoBin" goto skip

if not exist "cmdacoBin" goto noskip

:noskip

md "cmdacoBin"

goto skip

:skip

cd "%userprofile%\documents\cmdacoBin"

if exist "%newname%.bat" goto namexist

if not exist "%newname%.bat" goto skip2

:skip2

echo set realusername=%newname%> "%newname%.bat"

goto next

:next

echo.

set /p pswd=Enter new Password:

if "%pswd%"=="%pswd%" goto inputpass

:inputpass

cd "%userprofile%\documents\cmdacoBin"

echo set password=%pswd%>> "%newname%.bat"

goto next1

:namexist

echo.

echo The entered username already exists.

echo Press any key to return. . .

pause >nul

goto 2

:next1

cls

echo P@G Accounts

echo ============

echo.

echo Your account For P@G has been created!

echo.

pause

goto home

:1

color 07

cls

echo Patrick Maranon Accounts Log In

echo ================================

echo.

Set /p logname=Username:

if "%logname%"=="%logname%" goto 2.1

:2.1

echo.

cls

echo Welcome, %logname%

echo.

set /p logpass="Password:"

if "%logpass%"=="%logpass%" goto login

:login

cd "%userprofile%\documents\cmdacoBin"

if exist "%logname%.bat" goto call

if not exist "%logname%.bat" goto errorlog

:call

call "%logname%.bat"

if "%password%"=="%logpass%" goto logdone

goto errorlog

:errorlog

color 0c

echo.

echo Username or Password incorrect.

echo Access denied.

pause >nul

goto home

:logdone

cls

echo Command Prompt

echo ==============

echo.

echo Successfully logged in!

echo.

pause

goto account

:account

cls

cd "%userprofile%\documents\cmdacoBin"

call "%realusername%color.bat"

call "%realusername%.bat"

color %colorcode%

cls

echo.

echo _______________________________________________________________________________

echo Welcome, %realusername%!

echo _______________________________________________________________________________

@echo off

break off

title Patrick Maranon's Trivia Beta Update Version 2.0

color 0a

:name

cls

echo Welcome to Version 2.0 of Patrick's Trivia. Codename Crystalline.

echo.

echo You Have Already Signed In To Your P@G Account.

echo.

cls

echo Now, Please enter your name.

echo.

set /p name=Type Name Here

echo.

cls

echo Welcome Back, %name%

echo.

pause

goto mainmenu

:mainmenu

cls

echo _______________________________________

echo.

echo Main Menu

echo.

echo ________________________________________

echo.

echo To Continue, Please Choose One Of The Following.

echo.

echo Type 1 for a New Game

echo Type 2 to go to Question selction

echo Type 3 to exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto SELECT

if %num%==3 goto END

if %num--9691 goto !

:SELECT

cls

echo To See The Available Questions, press the enter key.

pause >nul

goto SELECT20

:SELECT20

cls

echo __________________________________

echo.

echo Available Questions:

echo.

echo __________________________________

echo.

echo Please use lowercase when selecting.

echo.

echo Sorry, Question Selection Not Working Currently For This Update.

echo.

echo QUESTION ONE

echo.

echo QUESTION TWO

echo.

echo QUESTION THREE

echo.

echo QUESTION FOUR

echo.

echo QUESTION FIVE

echo.

echo QUESTION SIX

echo.

echo QUESTION SEVEN

echo.

echo QUESTION EIGHT

echo.

echo QUESTION NINE

echo.

echo QUESTION TEN

echo.

echo Choose ZERO To Go Back.

echo.

set /p %num%=Select:

if %num%==zero goto mainmenu

if %num%==one goto QUESTION1

if %num%==two goto QUESTION2

if %num%==three goto QUESTION3

if %num%==four goto QUESTION4

if %num%==five goto QUESTION5

if %num%==six goto QUESTION6

if %num%==seven goto QUESTION7

if %num%==eight goto QUESTION8

if %num%==nine goto QUESTION9

if %num%==ten goto QUESTION10

:NEW

cls

echo PROGRAM - GAME HAS STARTED.>>RESULTS.txt

cls

echo WELCOME! To Patrick's Trivia Beta Update Version 2.0. Let's Begin the game. Directions: Please answer these multiple choice questions by entering the number of the answer you think is correct. There will be 10 questions. Have Fun!

pause >nul

goto QUESTION1

:QUESTION1

cls

color C0

echo __________ QUESTION 01/10 __________ Points- 0

echo ______ Let's say the 60 inch Sharp Aquos TV is $1,482. How much will the 30 inch be? ______

echo 1.$741

echo 2.$1.765

echo 3.$550

echo 4.$9

echo.

set /p num=Select:

if %num%==1 goto QUESTION2

if %num%==2 goto LOSE1

if %num%==3 goto LOSE1

if %num%==4 goto LOSE1

if %num%=0 goto ERROR

:LOSE1

cls

echo QUESTION 01 ANSWERED WRONG.>>RESULTS.txt

echo Oh No! You Lost. You Have 0 Points. Choose A Command And Type The Number and Press Enter

echo 1 Start over from the beginning

echo 2 Go to MAIN MENU

echo 3 Exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto INTRO

if %num%==3 goto END

if %num%=0 goto ERROR

:QUESTION2

cls

color C0

echo __________ QUESTION 02/10 __________ Points- 5

echo ______ If you take MOM, and flip it upside down, what word would you see? ______

echo 1.PATRICK

echo 2.DAD

echo 3.MOM

echo 4.WOW

echo.

set /p num=Select:

if %num%==1 goto LOSE2

if %num%==2 goto LOSE2

if %num%==3 goto LOSE2

if %num%==4 goto QUESTION3

if %num%=0 goto ERROR

:LOSE2

cls

echo QUESTION 01 ANSWERED WRONG.>>RESULTS.txt

echo Oh No! You Lost. You Have 5 Points. Choose A Command And Type The Number and Press Enter

echo 1 Start over from the beginning

echo 2 Go to MAIN MENU

echo 3 Exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto INTRO

if %num%==3 goto END

if %num%=0 goto ERROR

:QUESTION3

cls

color C0

echo __________ QUESTION 03/10 __________ Points- 10

echo ______ Do you think lilly is pregnant? ______

echo 1. Yes

echo 2. No

echo 3. Maybe

echo 4. So

echo.

set /p num=Select:

if %num%==1 goto QUESTION4

if %num%==2 goto QUESTION4

if %num%==3 goto QUESTION4

if %num%==4 goto QUESTION4

if %num%=0 goto ERROR

:LOSE3

cls

echo QUESTION 01 ANSWERED WRONG.>>RESULTS.txt

echo Oh No! You Lost. You Have 10 Points. Choose A Command And Type The Number and Press Enter

echo 1 Start over from the beginning

echo 2 Go to MAIN MENU

echo 3 Exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto INTRO

if %num%==3 goto END

if %num%=0 goto ERROR

:QUESTION4

cls

color C0

echo __________ QUESTION 04/10 __________ Points- 15

echo ______ Does Loh Loh Smell? ______

echo 1. No

echo 2. No

echo 3. Yes

echo 4. No

echo.

set /p num=Select:

if %num%==1 goto QUESTION5

if %num%==2 goto QUESTION5

if %num%==3 goto QUESTION5

if %num%==4 goto QUESTION5

if %num%=0 goto ERROR

:LOSE4

cls

echo QUESTION 01 ANSWERED WRONG.>>RESULTS.txt

echo Oh No! You Lost. You Have 15 Points. Choose A Command And Type The Number and Press Enter

echo 1 Start over from the beginning

echo 2 Go to MAIN MENU

echo 3 Exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto INTRO

if %num%==3 goto END

if %num%=0 goto ERROR

:QUESTION5

cls

color C0

echo __________ QUESTION 05/10 __________ Points- 20

echo ______ Is Cody irritating? ______

echo 1. Yes

echo 2. Yes

echo 3. Yes

echo 4. Yes

echo.

set /p num=Select:

if %num%==1 goto QUESTION6

if %num%==2 goto QUESTION6

if %num%==3 goto QUESTION6

if %num%==4 goto QUESTION6

if %num%=0 goto ERROR

:LOSE5

cls

echo QUESTION 01 ANSWERED WRONG.>>RESULTS.txt

echo Oh No! You Lost. You Have 20 Points. Choose A Command And Type The Number and Press Enter

echo 1 Start over from the beginning

echo 2 Go to MAIN MENU

echo 3 Exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto INTRO

if %num%==3 goto END

if %num%=0 goto ERROR

:QUESTION6

cls

color C0

echo __________ QUESTION 06/10 __________ Points- 25

echo ______ Do you love our white couch? ______

echo 1. Yes

echo 2. No

echo 3. No

echo 4. Yes

echo.

set /p num=Select:

if %num%==1 goto QUESTION7

if %num%==2 goto QUESTION7

if %num%==3 goto QUESTION7

if %num%==4 goto QUESTION7

if %num%=0 goto ERROR

:LOSE6

cls

echo QUESTION 01 ANSWERED WRONG.>>RESULTS.txt

echo Oh No! You Lost. You Have 25 Points. Choose A Command And Type The Number and Press Enter

echo 1 Start over from the beginning

echo 2 Go to MAIN MENU

echo 3 Exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto INTRO

if %num%==3 goto END

if %num%=0 goto ERROR

:QUESTION7

cls

color C0

echo __________ QUESTION 07/10 __________ Points- 30

echo ______ What's Lilly's Real First Name? ______

echo 1. Barbara

echo 2. Sue

echo 3. Elizabeth

echo 4. Cody

echo.

set /p num=Select:

if %num%==1 goto LOSE7

if %num%==2 goto LOSE7

if %num%==3 goto QUESTION8

if %num%==4 goto LOSE7

if %num%=0 goto ERROR

:LOSE7

cls

echo QUESTION 01 ANSWERED WRONG.>>RESULTS.txt

echo Oh No! You Lost. You Have 30 Points. Choose A Command And Type The Number and Press Enter

echo 1 Start over from the beginning

echo 2 Go to MAIN MENU

echo 3 Exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto INTRO

if %num%==3 goto END

if %num%=0 goto ERROR

:QUESTION8

cls

color C0

echo __________ QUESTION 08/10 __________ Points- 35

echo ______ What note is DOE in a c scale? ______

echo 1. A

echo 2. C

echo 3. B

echo 4. D

echo.

set /p num=Select:

if %num%==1 goto LOSE8

if %num%==2 goto QUESTION9

if %num%==3 goto LOSE8

if %num%==4 goto LOSE8

if %num%=0 goto ERROR

:LOSE8

cls

echo QUESTION 01 ANSWERED WRONG.>>RESULTS.txt

echo Oh No! You Lost. You Have 35 Points. Choose A Command And Type The Number and Press Enter

echo 1 Start over from the beginning

echo 2 Go to MAIN MENU

echo 3 Exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto INTRO

if %num%==3 goto END

if %num%=0 goto ERROR

:QUESTION9

cls

color C0

echo __________ QUESTION 09/10 __________ Points- 40

echo ______ Which dog breed is NOT chinese? ______

echo 1. Bulldog

echo 2. Pug

echo 3. Sharpei

echo 4. Crested

echo.

set /p num=Select:

if %num%==1 goto QUESTION10

if %num%==2 goto LOSE9

if %num%==3 goto LOSE9

if %num%==4 goto LOSE9

if %num%=0 goto ERROR

:LOSE9

cls

echo QUESTION 01 ANSWERED WRONG.>>RESULTS.txt

echo Oh No! You Lost. You Have 40 Points. Choose A Command And Type The Number and Press Enter

echo 1 Start over from the beginning

echo 2 Go to MAIN MENU

echo 3 Exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto INTRO

if %num%==3 goto END

if %num%=0 goto ERROR

:QUESTION10

cls

color C0

echo FINAL QUESTION

echo __________ QUESTION 10/10 __________ Points- 45

echo ______ 36+48-26/2x3= ______

echo 1.92

echo 2.87

echo 3.46

echo 4.31

echo.

set /p num=Select:

if %num%==1 goto LOSE10

if %num%==2 goto WIN

if %num%==3 goto LOSE10

if %num%==4 goto LOSE10

if %num%=0 goto ERROR

:LOSE10

cls

echo QUESTION 01 ANSWERED WRONG.>>RESULTS.txt

echo Oh No! You Lost. You Have 45 Points. Choose A Command And Type The Number and Press Enter

echo 1 Start over from the beginning

echo 2 Go to MAIN MENU

echo 3 Exit

set /p num=Select:

if %num%==1 goto NEW

if %num%==2 goto INTRO

if %num%==3 goto END

if %num%=0 goto ERROR

:WIN

cls

echo Oh No.

pause

cls

echo I am Really, Really sorry.

pause

cls

echo THAT YOU WON!!!!!!!!!!!!!!!! Points- 50!

echo.

echo You won the game!!!!!! Congratulations! Check RESULTS.txt You WIN!!!!!!!

echo.

color 30

echo ** ** **** ** ** *

echo * * * * * * *

echo * * * * * * *

echo * * * * * * *

echo ** ************ ** *

echo * * * * *

echo * * * * *

echo * * * *

echo * * * * *

ping localhost -n 5 >nul

pause

goto :EXTRAS

:EXTRAS

cls

echo GAME COMPLETE Please Do Not Exit This Window.

echo.

ping localhost -n 3.9 >nul

cls

echo Ejecting .bat File

echo Game Will Close Soon. Please Do Not Exit This Window.

ping localhost -n 2.9 >nul

cls

echo Ejecting .bat File

echo Game Will Close Soon. Please Do Not Exit This Window.

ping localhost -n 2.9 >nul

cls

echo Ejecting .bat File

echo Game Will Close Soon. Please Do Not Exit This Window.

ping localhost -n 2.9 >nul

cls

echo Closing All Files

echo Game Will Close Soon. Please Do Not Exit This Window.

ping localhost -n 3.5 >nul

cls

echo Closing .Cmd

echo CLOSING

ping localhost -n 5 >nul

goto END

:END

cls

echo GAME SESSION ENDED. DO NOT EXIT THIS WINDOW.

echo.

ping localhost -n 5 >nul

exit

Step 3: the Game

This is the hard step. Have Fun!