choice command problem

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
rana
Posts: 3
Joined: 10 Mar 2020 08:25

choice command problem

#1 Post by rana » 10 Mar 2020 08:36

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
Attachments
image.PNG
image.PNG (39.52 KiB) Viewed 3243 times

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: choice command problem

#2 Post by dbenham » 10 Mar 2020 09:58

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

Post Reply