I have written the following code
choice /m "Do you want to add another profile"
if errorlevel 1 set /p profile_name1=Enter one of the above profile names:
However it always runs “Enter one of the above profile names:” even though I pressed no. What did i do wrong?
Thanks!
You need to give instructions for each outcome.
E.g.:
Also note that the order is important, you must list the errorlevels in descending order (2 then 1).