@DIRSTACK[n] :  Returns the name of the nth entry in the directory stack. The oldest is number 0. If no n parameter is specified, returns the total number of entries in the stack. The directory stack is set by calls to PUSHD / POPD.

   

Numeric input may be entered in either decimal format (a sequence of 0-9 digits) or in hexadecimal format ("0x" followed by a sequence of 0-F hex digits).

 

See also: DIRS, POPD, PUSHD and Directory Navigation.

 

Examples:

 

pushd c:\windows

pushd c:\windows\system32

echo %@dirstack[0]

C:\

 

echo %@dirstack[1]

C:\Windows

 

echo %@dirstack[]

2