Command: popd

  POPD pops a directory off the directory stack (created by
  pushd) and changes to it.

Syntax:

  1. POPD
  2. POPD [*] [/?]

Options:

  *   Clears the directory stack.
  /?  Shows the help.

Comments:

  The first variant (see above) changes the current directory back to the
  one, in which the last PUSHD command was executed.
  The second one (*) clears all entries of the directory stack, but does
  not change the current directory.
  POPD is stored in the context segment (directory stack) of of
  command.com, for more information see: COMMAND /E:nnn and MEMORY.
  POPD 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
  pushd

  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.