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 * deletes all entries of the directory stack and
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.