Labb 9: Batch script

Konstruera ett prov på engelska om Nätverksadministration. Koden nedan behöver justeras och i vissa fall kompletteras för att provet ska fungera.

@echo off
:: Interacting with a user
echo ############################
echo #
echo # Testing your knowledge about
echo # Network Administration
echo # ver 0.1
echo #
echo ############################
echo.
pause
cls
color a
:: Page one #######################

:one.
echo.
echo 1.- Which of the following are required to create a domain controller successfully?
echo.
echo A) A valid DNS domain name
echo B) A FireWall server
echo C) A DHCP server to assign an IP address to the domain controller
echo D) A WINS server
echo.
set /p ch1=Enter your choice:
echo.
if not defined ch1 (goto one)
if %ch1%==A goto yes1
if %ch1%==B goto no1
if %ch1%==C goto no1
if %ch1%==D goto no1
echo.
echo Invalid choice, please try again!
pause>nul
goto one

:: Page no1

:no1
echo Sorry, That answer is incorrect. Try Again!
echo.
pause>nul
goto one

:: Pages yes1

:yes1.
echo.
echo You are correct! To create a domain requires a valid DNS domain name.
echo.
pause>nul
goto two

:: Page two ####################

:two
echo.
echo 2.- Which of the following groups can shut down a domain controller?
echo.
echo A) Account Operators
echo B) Installators
echo C) Internet Operators
echo D) Print Operators
echo.
set /p ch2=Enter your choice:
echo.
if not defined ch2 (goto two)
if %ch2%==A goto no2
if %ch2%==B goto no2
if %ch2%==C goto no2
if %ch2%==D goto yes2
echo.
echo Invalid choice, please try again!
pause>nul
goto two

:: Page no2

:no2
echo Sorry, That answer is incorrect. Try Again!
echo.
pause>nul
goto two

:: Page yes2

:yes2.
echo.
echo You are correct! Print Operators can shutdown a Domain Controller.
echo Server Operators and Backup Operators can also shutdown a DC.
echo.
pause>nul
goto three

:: Page three ##################

:three
echo.
echo 3.- You want to join a computer to the domain. Which command should you

use?
echo.
echo A) dsadd
echo B) netdom
echo C) dsget
echo D) dsjoin
echo.
set /p ch3=Enter your choice:
echo.
if not defined ch2 (goto three)
if %ch3%==A goto no3
if %ch3%==B goto yes3
if %ch3%==C goto no3
if %ch3%==D goto no3
echo.
echo Invalid choice, please try again!
pause>nul
goto three

:: Page no3

:no3.
echo Sorry, That answer is incorrect. Try Again!
echo.
pause>nul
goto three

:: Page yes3

:yes3
echo.
echo You are correct! netdom join can join computers to a domain.
echo.
pause>nul