Pushd


Applies To: Windows Vista,Windows Server 2008

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

For examples of how to use this command, see Examples.

Syntax


Copy Code

pushd [<Path>]

Parameters

Parameter

Description

<Path>

Specifies the directory to make the current directory. This command supports relative paths.

/?

Displays help at the command prompt.

Remarks

Examples

The following example shows how you can use the pushd command and the popd command in a batch program to change the current directory from the one in which the batch program was run and then change it back:


Copy Code

@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

Additional references

Command-Line Syntax Key

Popd