It continues 9 through 1, but doesn't match so goes to :end
choice /C 123456780 /N /M "Type a number or close the window to cancel:" if ERRORLEVEL 9 ( do stuff goto end ) if ERRORLEVEL 8 ( do stuff goto end ) :end
What I found is that I can echo %errorlevel% and get the proper value returned from choice, but if I try to do anything else it becomes null or 0, not sure.
if errorlevel 1 goto 1 if errorlevel 2 goto 2 1: stuff goto end 2: stuff goto end :end
|Check if a folder exists in a batch file, If it does to rename it with date and time stamp on the current drive.||5||66|
|Batch Script for opening the DOS prompt and run a command||9||105|
|Need to delete empty sub dirs but not include the directory itself||10||67|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
16 Experts available now in Live!