Category : Assembly Language Source Code
Archive   : DOCFILES.ZIP
Filename : PUSHDIR.DOC

Output of file : PUSHDIR.DOC contained in archive : DOCFILES.ZIP

PUSHDIR (and POPDIR) John Friend
Commands PC Magazine Vol 5, No 10
Copyright 1986 Ziff-Davis Publishing Company

Purpose: Provides a way to return automatically to
your current directory after running programs
that require directory changing.

[CD \AltDir\ProgName]

Remarks: While PUSHDIR and POPDIR can be entered
directly from the DOS prompt, their primary
application is in batch files. For example,
suppose you create a file named 12.BAT that
consists of the following four lines:


Suppose also that 12.BAT, PUSHDIR.COM, and
POPDIR.COM are either in your root directory
or in a subdirectory on the PATH specified in
your AUTOEXEC.BAT file. Assume, finally,
that you are currently in your word
processing subdirectory (\WP), but need some
information from a 1-2-3 spreadsheet. If you
now enter


from the DOS prompt, PUSHDIR stores the \WP
(your current directory) on its stack and DOS
changes to the \LOTUS subdirectory and runs
1-2-3. When you exit from 1-2-3, you would
normally be left in the \LOTUS subdirectory.
A DOS CD command in 12.BAT after the 123 line
could return you to a specified directory
every time you terminated 1-2-3, of course.
But POPDIR returns you to whatever
subdirectory you were in when you invoked 1-
2-3--in this case, to your \WP subdirectory.

PUSHDIR can accommodate up to six levels of
directories on its stack, permitting
considerable programming flexibility in
constructing batch files.


1. PUSHDIR and POPDIR require DOS 2.0 or

  3 Responses to “Category : Assembly Language Source Code
Archive   : DOCFILES.ZIP
Filename : PUSHDIR.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: