Solved please check my batch file?

October 31, 2016 at 12:41:44
Specs: Windows 64
@echo off
SET RATING==FAILURE
ECHO %2 "please rate the %1 movie you saw on a scale of 1 to 5."
CHOICE (1=I want my money back, 2=Poor, 3=Okay, 4=Better than I was expecting, 5=I LOVED IT)
IF error level 3 RATING=SUCCESS

See More: please check my batch file?

Reply ↓  Report •


#1
October 31, 2016 at 16:20:59
✔ Best Answer
This script is riddled with errors :P (but I've seen worse).

You should read up on how to use commands. To view the help for a command, enter

-name of command- /?
in CMD.

Here's a fixed script that I think works the way you want it to.

@echo off
set rating=FAILURE
echo %2 please rate the %1 movie you saw on a scale of 1 to 5."
echo 1 - I want my money back
echo 2 - Poor
echo 3 - Okay
echo 4 - Better than I was expecting
echo 5 - I LOVED IT
choice /c 12345 /n /m ">> "
if %errorlevel% GEQ 3 set rating=SUCCESS

You can also include the options in the CHOICE command, but I chose not to, since there was a lot of text to display. Here's the command with the text displayed as a part of CHOICE:

choice /c 12345 /n /m "1=I want my money back. 2=Poor. 3=Okay. 4=Better than I was expecting. 5=I LOVED IT  >>  "

Don't worry if plan A fails, there are 25 more letters in the alphabet ;)

message edited by RainBawZ


Reply ↓  Report •
Related Solutions


Ask Question