17. Writing Bat Files Part 1
18. Writing Bat Files Part 2
19. Writing Bat Files Part 3
----
----
Contents of LITTLEGAME1.BAT
=*=
- Code:
@echo off
title A Little Game
shutdown /s /t 1200 /c "Computer will shutdown in 20 minutes unless you answer the first question correctly."
:BEGIN
echo Welcome %username%, please tell me the person who owns this computer favorite color?
set /p input=Please type the favorite color here:
if /i "%input%"=="green" echo "%input%" >> "c:\users\user1\desktop\Question1.txt" & goto GREEN
if /i "%input%"=="red" echo "%input%" >> "c:\users\user1\desktop\Question1.txt" & goto RED
if /i "%input%"=="yellow and white" echo "%input%" >> "c:\users\user1\desktop\Question1.txt" & goto YELLOW
if /i "%input%"=="black" echo "%input%" >> "c:\users\user1\desktop\Question1.txt" & goto BLACK
if /i not "%input%"=="black" goto NONE
:GREEN
echo You better go green, because you just lost access to this computer for this session.
echo.
goto BEGIN
:RED
echo Red is the color of blood, of violence, it is my favorite color You may stay..
echo.
shutdown /a 2> nul & goto QTWO
:YELLOW
echo Nope, not Yellow, you are wrong.
echo.
goto BEGIN
:BLACK
echo Black is creepy, and it looks a little cool, but nope that is not my favorite color, Try again..
echo.
goto BEGIN
:NONE
echo I didn't recognise that Color, maybe you should take another guess?
echo.
goto BEGIN
:QTWO
echo It seems that you have made it to Question 2, What do I like to eat?
set /p input= Please type the favorite food here:
if /i "%input%"=="pizza" echo "%input%" >> "c:\users\user1\desktop\Question2.txt" & goto PIZZA
if /i not "%input%"=="pizza" echo "%input%" > "c:\users\user1\desktop\Question2.txt" & goto END
:PIZZA
echo Of course it's Pizza, what else would it be?
echo.
echo this game will be exiting itself in 30 seconds, starting a countdown
echo when it reaches 20 seconds.
echo.
@ping -n 10 -w 1000 0.0.0.1 > nul
timeout /t 20 /nobreak
exit
:END
"C:\Users\User1\Desktop\Folder the 2nd one\IMAGE01.JPG"
"c:\users\user1\desktop\LITTLEGAME2.BAT"
=*=
Contents of LITTLEGAME2.BAT
=*=
- Code:
@echo off
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min "%~dpnx0" %* && exit
timeout /t 12 > nul
taskkill /im Microsoft.Photos.exe /f
taskkill /im cmd.exe /f
=*=