home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / pcmag / pushdir.lzh / PUSHDIR.DOC < prev   
Text File  |  1988-11-24  |  2KB  |  55 lines

  1.           PUSHDIR (and POPDIR)                       John Friend
  2.           ______________________________________________________
  3.  
  4.           Purpose:  Provides a way to return automatically to
  5.                     your current directory after running programs
  6.                     that require directory changing.
  7.  
  8.           Format:   PUSHDIR
  9.                     [CD \AltDir\ProgName]
  10.                     POPDIR
  11.  
  12.           Remarks:  While PUSHDIR and POPDIR can be entered
  13.                     directly from the DOS prompt, their primary
  14.                     application is in batch files.  For example,
  15.                     suppose you create a file named 12.BAT that
  16.                     consists of the following four lines:
  17.  
  18.                          PUSHDIR
  19.                          CD\LOTUS
  20.                          123
  21.                          POPDIR
  22.  
  23.                     Suppose also that 12.BAT, PUSHDIR.COM, and
  24.                     POPDIR.COM are either in your root directory
  25.                     or in a subdirectory on the PATH specified in
  26.                     your AUTOEXEC.BAT file.  Assume, finally,
  27.                     that you are currently in your word
  28.                     processing subdirectory (\WP), but need some
  29.                     information from a 1-2-3 spreadsheet.  If you
  30.                     now enter
  31.  
  32.                          12<CR>
  33.  
  34.                     from the DOS prompt, PUSHDIR stores the \WP
  35.                     (your current directory) on its stack and DOS
  36.                     changes to the \LOTUS subdirectory and runs
  37.                     1-2-3.  When you exit from 1-2-3, you would
  38.                     normally be left in the \LOTUS subdirectory.
  39.                     A DOS CD command in 12.BAT after the 123 line
  40.                     could return you to a specified directory
  41.                     every time you terminated 1-2-3, of course.
  42.                     But POPDIR returns you to whatever
  43.                     subdirectory you were in when you invoked 1-
  44.                     2-3--in this case, to your \WP subdirectory.
  45.  
  46.                     PUSHDIR can accommodate up to six levels of
  47.                     directories on its stack, permitting
  48.                     considerable programming flexibility in
  49.                     constructing batch files.
  50.  
  51.                     Notes:
  52.  
  53.                     1.   PUSHDIR and POPDIR require DOS 2.0 or
  54.                          later.
  55.