The use of pushd and POPD command in CMD

Time:2021-4-7

Pushd command
Save the current directory for POPD command, and then change to the specified directory.

PUSHD [path | ..]

Path specifies the directory to be the current directory.

If command extension is enabled, pushd is used in addition to the general drive letter and path
The command also accepts network paths. If a network path is specified, pushd creates one
Point to the temporary drive letter of the specified network resource, and then use the newly defined drive
To change the current drive and directory. Temporary drives can be assigned from Z: down
To use the first unused drive letter found.

POPD command
Change to the directory where the pushd command is stored.

If command extension is enabled, when POPD drive is pushed from directory stack, POPD
The command removes the temporary drive letter created by pushd.
for example
Pushd C: is to record the C: disk. When you transfer to the E: disk, you can use POPD to transfer back to the C disk