Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Problem with the choice command under ms-dos 8.0

Avatar of Mario Zio
Mario ZioFlag for Italy asked on
Microsoft DOSWindows OSWindows Batch
22 Comments1 Solution788 ViewsLast Modified:

I'm working on a script and I have problems running the choice command. This is :


choice /c:12 /n Format a:,g: ?
if errorlevel 1 goto a
if errorlevel 2 goto fine

format a:
goto fine

format g:
goto fine


choice /c:1234567 /n Format b:,c:,d:,e:,f:,a:,g: ?
if errorlevel 1 goto b
if errorlevel 2 goto c
if errorlevel 3 goto d
if errorlevel 4 goto e
if errorlevel 5 goto f
if errorlevel 6 goto a
if errorlevel 7 goto fine

format b:
goto fine

format c:
goto fine

format d:
goto fine

format e:
goto fine

format f:
goto fine

format a:
goto fine

format g:
goto fine


the problem born when I choose an option from 1 to 7 inside the Block 2 the script always jumps on block 1 and it executes the code under the :a section. How can I fix it ?
Avatar of Ben Personick (Previously QCubed)
Ben Personick (Previously QCubed)Flag of United States of America imageLead SaaS Infrastructure Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 22 Comments.
See Answers