choice command in dos executing both options

January 29, 2011 at 12:29:16
Specs: Windows 7
echo Should the carter1 file be copied to the B: drive?
choice /C YN /M "press Y for yes, press N for no."
if errorlevel== 2 goto two
if errorlevel== 1 goto one
:two
echo the carter1 file will not be copied, what would you like to do next?
:one
copy carter1 c:

When option two (errorlevel 2) is selected, it still runs the copy command in option 1, How do I prevent it from copying when option two is selected?


See More: choice command in dos executing both options

Report •

#1
January 29, 2011 at 12:33:06
echo Should the carter1 file be copied to the B: drive?
choice /C YN /M "press Y for yes, press N for no."
if errorlevel 2 goto two
if errorlevel 1 goto one
:two
echo the carter1 file will not be copied, what would you like to do next?
GOTO Next
:one
copy carter1 c:
:Next

Can I put a question here?


Report •
Related Solutions


Ask Question