home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 01e / miscutil.zip / @.DOC < prev    next >
Text File  |  1986-07-21  |  5KB  |  128 lines

  1. page 1
  2.      ------------------------------------------------------------
  3.     |   @ AN IMMEDIATE BATCH UTILITY  Rev. 1.0, 12/16/85 V.Bly   |
  4.     |                                 |
  5.     | Send comments, criticisms, and small contributions to:     |
  6.     |  Vince Bly, Nanosoft, P.O. Box 409, Ft. Belvoir, VA  22060 |
  7.      ------------------------------------------------------------
  8.  
  9. PURPOSE
  10.     Provides an immediate batch mode where several commands may be
  11.     entered on a single DOS command line.  Each command will be
  12.     executed in sequence.  Provides many of the capabilitys of batch
  13.     files without the necessity of creating a batch file.  It also
  14.     can be used to enhance batch files, providing redirection of the
  15.     output of a batch file and enhancing the batch FOR...DO command.
  16.  
  17. FORMAT
  18.     @ [option(s)] command [arg(s)] @ command [arg(s)] @ command [arg(s)]...
  19.     Example:  @ ~e copy *.bas c:\backups @ copy *.bas a: @ dir *.bas.
  20.  
  21. OPTIONS
  22.     ~E echo on (echo may be redirected).
  23.     ~S echo to screen (echo not redirected).
  24.     ~N no changing of {, !, and } to <, |, and >.  See REDIRECTION.
  25.  
  26. SPECIAL COMMAND (PZ)
  27.     The internal command pz waits for <SPACE> to cont. or <BREAK> to abort.
  28.  
  29. ERROR
  30.     Errorlevel is not (and cannot) be supported.  See NOTES.
  31.  
  32. REDIRECTION
  33.     GLOBAL redirection uses the standard <, |, and > symbols.
  34.     Example:  @ dir a: @ dir b:>ab.dr  creats one file ab.dr with
  35.     directories of drives A & B.
  36.  
  37.     LOCAL redirection uses the { ! and } symbols.
  38.     Example:  @ dir a:}a.dr @ dir b:}b.dr  creats two files, a.dr
  39.     has the directory of A and b.dr has the directory of B.
  40.  
  41.  
  42. @ WITH BATCH FILES
  43.     @ can be used to redirect the output of a batch file or expand
  44.     the batch FOR...DO command.
  45.  
  46.     Assume that you have a batch file called TWODIR.BAT, like the
  47.     following:
  48.     ECHO OFF
  49.     DIR %1
  50.     DIR %2
  51.     Issuing the command:  TWODIR *.BAS *.BAT>NEWDIR.TXT  will display
  52.     directories of all .BAS files then all .BAT files, but they will
  53.     not be redirected to the text file NEWDIR.TXT.    However, issuing
  54.     the command:  @ TWODIR *.BAS *.BAT>NEWDIR.TXT  will creat a text
  55.     file containing both directories.
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66. page 2
  67.  
  68. @ WITH BATCH FILES (continued)
  69.     The batch FOR...DO command is potentially very powerful; however,
  70.     only a single command can follow the DO.  It could, for example,
  71.     be used to copy all *.PAS files to drive C:, but there is no way
  72.     to select which .PAS files are copied.    @ can be used to expand
  73.     the FOR...DO command since an @ string appears as one command to
  74.     the batch processor.  As an example, type in the following batch
  75.     file named DUP.BAT.
  76.     ECHO OFF
  77.     FOR %%F IN (%2) DO @ @ ECHO %1 %%F %3 ? @ PZ @ %1 %%F %3 @ PAUSE
  78.     Now, assuming you have several .BAT files in the current directory,
  79.     issue the command:  DUP TYPE *.BAT
  80.     If you have entered everything correctly, you will now be asked,
  81.     sequentially, if you want to type each .BAT file.  For each .BAT
  82.     file in the directory, you should see a display like:
  83.  
  84.     TYPE MYOWN.BAT ?
  85.  
  86.     Press <SPACE> to continue or <BREAK> to exit...
  87.  
  88.     If you want to see the contents of MYOWN.BAT, press the <Space>
  89.     bar, otherwise press <Ctrl><Break> once and you will skip to the
  90.     next .BAT file.  Press <Ctrl><Break> twice in succession to exit
  91.     the DUP batch file.
  92.  
  93.     The first two @'s, separated by a space, produce an extra blank
  94.     line.  Responding with <Break> to the PZ command exits the current
  95.     @ sequence, skipping to the next iteration of the FOR..DO loop.
  96.     The DUP.BAT batch program can be used to selectively operate on
  97.     any members of a wildcard set (such as *.COM, A.*, etc.) with
  98.     any DOS command as long as the wildcard set does not include path
  99.     names (the FOR..DO command [pre-DOS 3.0] cannot process paths).
  100.     For example: DUP COPY *.BAS C:\BASBACKS.  For maximum speed using
  101.     DUP, see the comments on changing the location of COMMAND.COM in
  102.     the NOTES below.
  103.  
  104. NOTES
  105.     @ can only be used with DOS 2.0 or later.  The maximum length of
  106.     an @ string is 127 characters.
  107.  
  108.     @ operates by envoking a secondary copy of the command processor
  109.     for each command.  It finds the processor by examining the current
  110.     environment (looking for COMSPEC=processor location and name).
  111.     @ cannot process error return codes since the codes are returned
  112.     to the secondary processor and are not readily available to the
  113.     primary processor which is executing @.EXE.
  114.  
  115.     If you use a ram disk, you can speed the operation of @ strings
  116.     (and other programs) by copying command.com to your ram disk and
  117.     setting its new location in the environment.  As an example, let's
  118.     assume that your ram disk is designated as drive D: and you booted
  119.     from your hard disk, drive C:, then you would proceed as follows:
  120.     COPY C:\COMMAND.COM D:\
  121.     SET COMSPEC=D:\COMMAND.COM
  122.     Now, whenever command.com is reloaded, it will be loaded from your
  123.     ram disk instead of your hard disk.  WARNING, if you need to format
  124.     a disk using the /S option, you will need to reset command.com to
  125.     its original location (where the hidden files ibmbio.com and
  126.     ibmdos.com are located).  For example: SET COMSPEC=C:\COMMAND.COM.
  127.  
  128.