Ashton
Ashton

Reputation: 35

How to use PUSHD and POPD

I am getting an "UNC path not supported" error while trying to get files from a shared network drive.

My research tells me that pushd and popd may help, but I can't figure out how to use them correctly.

What are good usage examples for pushd and popd?

Upvotes: 3

Views: 7151

Answers (2)

shanmuga raja
shanmuga raja

Reputation: 725

The remarks about popd given in microsoft docs is misleading. It says "If you use the popd command, the directory on the top of the stack is removed from the stack and the current directory is changed to that directory.". But actually the current directory changes to the directory currently on the top of the stack.

Upvotes: 0

nexyr
nexyr

Reputation: 96

C:
dir
pause

rem ----- using pushd to other path

pushd Users
dir
pause 

rem ----- using popd to exit current pushd directory
popd
dir
pause

Upvotes: 5

Related Questions