windows batch if yes no prompt code example
Example 1: y/n cmd
:choice
set /P c=Are you sure you want to continue[Y/N]?
if /I "%c%" EQU "Y" goto :somewhere
if /I "%c%" EQU "N" goto :somewhere_else
goto :choice
Example 2: how to make yes no question in bat scrip script
@echo off
echo Are you a programmer?
choice
IF ERRORLEVEL 2 goto No
IF ERRORLEVEL 1 GOTO Yes
:Yes
echo You are a programmer! :)
timeout 5
exit
:No
echo you are not a programmer! :(
timeout 5
exit