To print the directory stack, use the command pushd
without any parameters:
@echo off
cd C:\example\
pushd one
pushd ..\two
pushd ..\..
pushd
echo Current Directory: %cd%
echo:
popd
pushd three
pushd
echo Current Directory: %cd%
Output:
C:\example\two
C:\example\one
C:\example
Current Directory: C:\
C:\example\two
C:\example\one
C:\example
Current Directory: C:\example\two\three