Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-lcc!rutgers!husc6!bu-cs!bucsb.bu.edu!madd From: madd@bucsb.bu.edu.UUCP (Jim "Jack" Frost) Newsgroups: comp.sys.ibm.pc Subject: Batch file nesting (was: Re: printing > 10 files) Message-ID: <677@bucsb.bu.edu.UUCP> Date: Sat, 20-Dec-86 14:32:51 EST Article-I.D.: bucsb.677 Posted: Sat Dec 20 14:32:51 1986 Date-Received: Sat, 20-Dec-86 22:44:10 EST References: <88@bcsaic.UUCP> Reply-To: madd@bucsb.bu.edu.UUCP (Jim "Jack" Frost) Organization: ODO (Organization for the Disorganization of Organization) Lines: 32 Summary: You shouldn't do that Mood: Hungover In article <88@bcsaic.UUCP> michaelm@bcsaic.UUCP (Michael Maxwell) writes: >[...] >Maybe something along the following lines would work: > for %F in * print2 %F >--where print2.bat contains: > again: print %1 > if errorlevel 1 goto again >Again, this seems wasteful of machine cycles... (I may not have the syntax >right, I don't have a PC here.) Syntax should be: :again print %1 if errorlevel 1 goto :again I believe. This method is a bad idea. DOS is rather limited in its handling of batch files: You can have one, and only one, running at once. Once you nest them, you lose the first batch file. Your example *might* work because it's only one line, but don't bet on it. As a rule, never NEVER try nesting batch files like that. Instead, you should have: for %F in * command -c print2 %F which should work just fine. Don't flame me if the if command syntax here is wrong; I'm interested in nesting problems here. Good luck with your problem. Maybe someone should write a new PRINT command that uses the errorlevel return. And give you more files if you want 'em, too.