home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol5n10.zip / PUSHDIR.DOC < prev   
Text File  |  1986-09-11  |  3KB  |  61 lines

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