Index | Notes Batch Examples


Quits the MS-DOS command interpreter (COMMAND.COM) and returns to the program that started the command interpreter, if one exists. Syntax EXIT


%[L01]% Echo % {------- This is ERROR -------} %off %[L02]% Echo There are an ASCII 7 char before the RROR in the BATCH %[L03]% Echo You'll hear a sound but you'll never see this message! %[L04]% For %%v in ( pause echo:on cls exit[L4]_ERROR.BAT :) do %%v @ %[L01]% Echo % {------- This is BATCH -------} %off %[L02]% Set Something=Wrong %[L03]% If Wrong!==%Something%! for %%c in (cho:on xit[L3]) do E%%c @pause. NO! :: or %[L03]% for %%e in (cho:on RROR: xit[L03]_%0) do E%%e %[L30]% for %%ÿ in (cho:on %0* xitÿon:ÿ[L30]) do e%%ÿ FAQ about line number 30: (Try to see it. -- Then read it:) _ Q. Why "%%ÿ" -- "%%v" A. If your somewhere deleted the ÿ; which is invisible in the MS-DOS Editor, then, you can always copy and paste it from the loop it self. _ Q. Why "cho:on xit" -- "Echo:on Exit" A. You'll see an endless loop. (cause of %0.) _ Q. Why do you put an ASCII 7 character () after the "xit" A. It's a delimitter to the Exit command. (also makes a sound in a speaker.) _ Q. Why is there a double Space in the "do e%%ÿ" A. Because it looks better. (Echo is on.) _ Q. Why is there an asterix in the "%0*" A. If the Lfnfor is on and the filename is "LongName BATCH.bat", that's why. PS.: Normally I do not always tell this. Some people think, that it's easy to change an existing batch file, which is written by another. Hmmm - I don't think, that all people always know; why it's written as it's?
-Top- | Notes Batch Examples