CmdID

CmdID / Commands

pushd

Stores the current directory for use by the popd command, and then changes to the specified directory. Windows commands reference

On Windows

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0

Stores the current directory for use by the popd command, and then changes to the specified directory. Every time you use the pushd command, a single directory is stored for your use. However, you can store multiple directories by using the pushd command multiple times. The directories are stored sequentially in a virtual stack, so if you use the pushd command once, the directory in which you use the command is placed at the bottom of the stack. If you use the command again, the second directory is placed on top of the first one. The process repeats every time you use the pushd command. If you use the popd command, the directory on the top of the stack is removed and the current directory is changed to that directory. If you use the popd command again, the next directory on the stack is removed. If command extensions are enabled, the popd command removes any drive-letter assignment created by the pushd command.

pushd [<path>]
@echo off
rem This batch file deletes all .txt files in a specified directory
pushd %1
del *.txt
popd
cls
echo All text files deleted in the %1 directory
<path>Specifies the directory to make the current directory. This command supports relative paths.
/?Displays help at the command prompt.

Several platforms

from tldr-pages, CC BY 4.0

Place a directory on a stack so it can be accessed later.

Switch to directory and push it on the stack

pushd path/to/directoryIdentify

Switch first and second directories on the stack

Rotate stack by making the 5th element the top of the stack

pushd +4Identify

Rotate the stack 4 times to the left (the current directory stays at the top by replacing the 5th element)

pushd -n +4Identify

Windows

from tldr-pages, CC BY 4.0

Place a directory on a stack so it can be accessed later.

Switch to directory and push it on the stack

pushd path\to\directoryIdentify