Ok so the title says it all. I want to write a test in batch coding.
I've succeeded so far in creating the questions, but the console keeps processing the answers as if they were commands and not simply a string variable.
Anyone know how to fix this? Here's the code:
More questions will be added to the script as I work.
I've succeeded so far in creating the questions, but the console keeps processing the answers as if they were commands and not simply a string variable.
Anyone know how to fix this? Here's the code:
Code:
cls
@ECHO OFF
COLOR 02
goto QUESTIONS
:FAIL
echo One of your questions was incorrect, please redo the test.
:QUESTIONS
echo TREE Questions
echo Question 1: How would you show the folders inside the drive F: (Using the TREE command)
set /p "answer=>"
if NOT %answer%== "TREE F:" goto FAIL
echo Question 2: How would you show the files AND folders inside the drive F:
set/p "answer"=>"
if NOT %answer%== "TREE F: /f" goto FAIL
echo MKDIR Usage
echo How would you create a folder named Important inside drive F:
set/p "answer=>"
if NOT "%answer%"== "MKDIR F:\Important"
:END
echo Congratulations you have finished the test!
pause