Reinaker: You can use PUSHD and POPD.
For example, if you start off in
Contrex's directory of
D:\My Folders\*censored*\Mom
And you want to go to the directory D:\Foo, you could use the command
pushd \Foo
Then to get back to the previous directory do
popd
Or if you wanted to go to C:\Documents and Settings you could use the command
pushd "C:\Documents and Settings"
Then to get back to the previous directory do
popd
Another tip ... if you are writing a batch file that changes directories and it ends up leaving you in a directory used by the batch file instead of the original, you can use the SETLOCAL command. Example:
@echo off
setlocal
cd \Temp
ren *.new *.old
In this example the batch file would leave you in whatever directory you started in. Without the SETLOCAL command, the batch file would leave you in \Temp.