Command: pushd
PUSHD pushes current directory onto the directory stack,
with the option to change current working directory.
Syntax:
PUSHD [[drive]path] [/?]
[[drive]path] is a path to which you wish to change.
Options:
/? Shows the help.
Comments:
PUSHD is a lot like CD, except that it stores the current directory
before changing it. Later on, POPD can be used to restore it.
PUSHD can be used several times, storing a stack of directories.
Using PUSHD without specifying a directory will store the current
directory, but not change it.
PUSHD is stored in the context segment (directory stack) of of
command.com, for more information see: COMMAND /E:nnn and MEMORY.
PUSHD is a command internal to command.com and needs no other file
in order to work.
Examples:
this command changes the current directory to / shows:
============ =========================================
cd c:\FREEDOS\BIN c:\FREEDOS\BIN
pushd c:\GAMES c:\GAMES (and stores c:\FREEDOS\BIN)
pushd c:\UTILS c:\UTILS (and stores c:\GAMES)
pushd c:\packages c:\packages (and stores c:\UTILS)
dirs shows the directories stored by pushd:
0001=c:\FREEDOS\BIN
0002=c:\GAMES
0003=c:\UTILS
popd c:\UTILS (and removes c:\UTILS (0003)
from directory stack)
popd c:\GAMES (and removes c:\GAMES (0002)
from directory stack)
popd c:\FREEDOS\BIN (and removes c:\FREEDOS\BIN
(0001) from directory stack)
popd shows the message: "Directory stack empty"
See also:
cd/chdir
cdd
command.com/freecom
dirs
memory
popd
Copyright © 2004 Robert Platt, updated 2011 and 2022 by W. Spiegl.
This file is derived from the FreeDOS Spec Command HOWTO.
See the file H2Cpying for copying conditions.