home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / doshelp / helpsb.zoo / help / batch / hints / param / examples.hlp next >
Encoding:
Text File  |  1989-01-01  |  2.6 KB  |  41 lines

  1. SAMPLE command and resulting output      | Comments about the output
  2.  
  3.   COPY A:%1  C:%2                          If these lines were in a BATCH file
  4.   DEL A:%1                                 UPDATE.BAT, the command line:
  5.   DIR C:%2 > A:%3.UPD                          UPDATE *.TXT \NEW RECORD
  6.   TYPE A:%3.UPD                            would substitute *.TXT for %1 and
  7.                                            \NEW for %2 and RECORD for %3 every
  8.                                            time %1 or %2 or %3 appeared in the
  9.                                            file. This could be used to transfer
  10.                                            some .TXT files from a diskette to 
  11.                                            a directory on a hard disk, and 
  12.                                            leave a record of the transfer on
  13.                                            the diskette, and display the 
  14.                                            updated directory on the screen.
  15.  
  16.   ECHO SEARCHING FOR "%1" IN FILES: %2     If these lines were in a BATCH file
  17.   FOR %%f IN (%2) DO FIND /N "%1" %%f      SEARCH.BAT, the command line:
  18.                                                SEARCH END *.ASM
  19. SEARCHING FOR "END" IN FILES: *.ASM        would substitute END for %1 and
  20.                                            *.ASM for %2 every time %1 or %2
  21. ---------- MAIN.ASM                        appeared in the file. This could
  22. [88] END                                   be used to be sure that the three
  23.                                            ASM files in a directory, called
  24. ---------- SUBR1.ASM                       MAIN.ASM, SUBR1.ASM, and SUBR2.ASM,
  25. [133]END                                   each had an END statement, or to
  26.                                            see how many lines were in each
  27. ---------- SUBR2.ASM                       file (assuming the END statement
  28. [9]  END                                   was last).
  29.  
  30.  
  31.  
  32.   IF EXIST %0.EXE %0 %1                    If these lines were in a BATCH file
  33.   IF NOT EXIST %0.EXE DEL %1               RM.BAT, the command line:
  34.                                                RM *.TXT
  35.                                            would substitute RM for %0 and 
  36.                                            *.TXT for %1 every time %0 or %1
  37.                                            appeared in the file. This could be
  38.                                            used to execute the RM.EXE program
  39.                                            if it existed, otherwise the DOS
  40.                                            DEL command would be used.
  41.