Name

popd

Synopsis

Changes back to the directory stored by pushd (see pushd later in this chapter).

Syntax

popd

Options

None.

Examples

Here’s a simple example of how popd together with pushd can be used in a batch file to return to the directory in which the batch file was started:

@echo off
' Batch file to delete all .TXT files in a specified directory
pushd %1
del *.txt
popd

Notes

The pushd/popd buffer is cleared after each time the command is used.

See Also

pushd

Get Windows 2000 Administration in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.