In my batch file I want to ask the user a question.
I wrote the following:
SET /P ANSWER=Click Y to continue or N to stop (Y/N)
but I get the message without the last ).
Someone know why?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because you’re using that prompt within a parenthesised block, e.g.
or
You have to escape the closing parenthesis in that case:
or quote the whole argument:
otherwise it closes the block. And if you had anything after that closing parenthesis you’d get a syntax error.
An easier method of what you do there would probably be the
choicecommand:You can then check the errorlevel afterwards to find out the user’s choice: