Purpose:Restore the disk drive and directory at the top of the directory stack

 

Format:POPD [/N /X * n] [name]

 

nThe number of directories to pop
nameDirectory name to match

 

/N (no directory change)

/X (exclude)

 

See also: DIRS, PUSHD, @DIRSTACK and Directory Navigation.

 

File Completion Syntax:

 

The default filename completion syntax is: dirs

 

Usage:

 

Each time you use the PUSHD command, it saves the current disk drive and directory on the internal directory stack. POPD restores the most recently saved drive and directory and removes that entry from the stack. You can use these commands together to change directories, perform some work, and return to the starting drive and directory.

 

Directory changes made with POPD are recorded in the directory history list and can be displayed in the directory history window. Read the section on Directory Navigation for complete details on this and other directory navigation features.

 

This example saves and changes the current disk drive and directory with PUSHD, and then restores it. The current directory is shown in the prompt:

 

[c:\] pushd d:\database\test

[d:\database\test] pushd c:\wordp\memos

[c:\wordp\memos] pushd a:\123

[a:\123] popd

[c:\wordp\memos] popd

[d:\database\test] popd

[c:\]

 

You can use the DIRS command to see the complete list of saved drives and directories (the directory stack).

 

The POPD command followed by an asterisk [*] clears the directory stack without changing the current drive and directory.

 

If the directory on the top of the stack is not on the current drive, POPD will switch to the drive and directory on the top of the stack without changing the default directory on the current drive.

 

You can optionally restore only the most recent directory in the stack which matches a name. For example:

 

POPD c:Pop the most recent directory on C:
POPD \\server\sharePop the most recent directory on the UNC share

 

The name to match can include wildcards.

 

Note that this means you can optionally choose to POPD to any directory in the directory stack, not just the most recent one.

 

Options:

 

/NPop the directory off  the stack, but don't change the directory.

 

/XDon't save the current directory to the Directory History list.