The command processor, CMD.EXE automatically defines the CD environment variable. Open a CMD.EXE window and type CD /D "%UserProfile%\My Documents" and press Enter. Then type @echo %CD% and press Enter to display the current directory.
If you wanted to go to the parent folder, type CD .. and press Enter.
If you wanted to script a process that displays the current directory, and each higher parent folder, until the root of the current drive is displayed, you could use the following script:
if "%CD:~3,1%" EQU "" goto finish
C:\Documents and Settings\Jerry
C:\Documents and Settings