POPD

Change directory back to the path/folder most recently stored by the PUSHD command.
POPD will also remove any temporary drive maps created by PUSHD

Syntax
      POPD 

PUSHD and POPD operate on a stack or LIFO (last in, first out) principle and so can be used multiple times.

Examples

   C:\Program Files> PUSHD c:\utils
   C:\utils> PUSHD c:\Windows
   C:\Windows> 
   C:\Windows> POPD
   C:\utils> 
   C:\utils> POPD
   C:\Program Files>

Errorlevels

If the directory is successfully changed %ERRORLEVEL% = unchanged, typically this will be 0 but if a previous command set an errorlevel, that will be preserved (this is a bug).

If a bad switch is given %ERRORLEVEL% = 1

POPD is an internal command. If Command Extensions are disabled the PUSHD command will no longer map temporary drives to UNC paths, and POPD will not delete such drives.

"It's amazing how low you go to get high" - John Lennon

Related commands

PUSHD - Change the current directory/folder and store the previous folder/path.
CD - Change Directory, select a Folder (and drive).
Equivalent PowerShell: Pop-Location - Set the current working location from the stack (popd).
Equivalent bash command (Linux):popd - Remove the top entry from the directory stack.


 
Copyright © 1999-2024 SS64.com
Some rights reserved