go back to where we came from – pushd popd
For those few who still write dos batch file, a couple of invaluable commands are pushd and popd. Many a time, we need to change the folder within a script and then go back to the previous folder. Pushd and Popd enable you to do just that. For. e.g. say you started your command shell using the ‘cmd’ command line, it opens up in the default location. Now instead of changing directories using the ‘cd’ command, you change them using ‘pushd’. This causes the folder to be pushed on to the folder history stack. You can then quickly go to top folder in the stack using ‘popd’. The following screenshot illustrates this
Another slick feature of ‘pushd’ is the ability to temporarily map a network folder to a local drive. A temporary drive letter is allocated to the network folder. This drive letter is then deleted when the corresponding ‘pop’ is done.