You can use label and goto to achive this. create a lable end of the batch file. ": FILE_ERROR
The check for the condition if it is false then use statement. "GOTO FILE_ERROR". This will send the cursor to last label. and will stop you can instert a echo command also after this. echo " Stopped for error." For more info check this site http://www.computerhope.com/batch.htm Regareds Rajeev ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 01, 2001 5:56 PM Subject: Return code to exit from a .bat file > I am doing a simple record length check on a series of files via a dos batch file e.g. check_length.bat: > > check_length.pl file1 100 > check_length.pl file2 200 > check_length.pl file3 300 > > > Is it possible to do something in perl (like a return code) so that the batch file aborts if say file2 is incorrect ? > > TIA > > Regards > > Mark Bedish > Surrey,UK > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]