Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!pacbell!att-ih!ihnp4!inuxc!iuvax!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxh.cso.uiuc.edu!emartins From: emartins@uxh.cso.uiuc.edu Newsgroups: comp.sys.ibm.pc Subject: Re: More on setting DOS errorlevel Message-ID: <19500008@uxh.cso.uiuc.edu> Date: 16 Mar 88 02:44:00 GMT References: <4835@sigi.Colorado.EDU> Lines: 23 Nf-ID: #R:sigi.Colorado.EDU:4835:uxh.cso.uiuc.edu:19500008:000:517 Nf-From: uxh.cso.uiuc.edu!emartins Mar 15 20:44:00 1988 The problem is that DOS tests ERRORLEVEL for a value GREATER THAN or EQUAL to whatever number you've specified on your batch file... So, you have to begin testing for the highest errorlevel. Try somethink like IF ERRORLEVEL 5 GOTO FOO1 IF ERRORLEVEL 4 GOTO FOO2 IF ERRORLEVEL 3 GOTO FOO3 GOTO END :FOO1 ECHO ERRORLEVEL IS FIVE! GOTO END :FOO2 ECHO ERRORLEVEL IS FOUR! GOTO END :FOO3 ECHO ERRORLEVEL IS THREE! :END This should work... Eduardo Martins (emartins@uxh.cso.uiuc.edu)