Page 1 of 1

choice command problem

Posted: 10 Mar 2020 08:36
by rana

Code: Select all

@echo off
echo "Choose the file size"
echo "A:10MB"
echo "B:20MB"
echo "C:30MB"

choice /c ABC /m "Choose Now :)"

I saved this script in the batch file and when tried executing it in a shell , it goes on and on in an endless loop and doesn't allow the user to choose ...
Why is it happening . :cry: I have attached a snap as proof

Re: choice command problem

Posted: 10 Mar 2020 09:58
by dbenham
You must have named your batch script choice.bat or choice.cmd, so your script is calling itself instead of executing the CHOICE command. Rename your script to something else.

You should never name a script the same as an existing command.


Dave Benham