The PushD and PopD commands in action
\n\tThe PushD/PopD commands
\n
\n\tAs you may know, the PushD and PopD commands have been around since Windows 2000 and are quite powerful little commands that can save you quite a bit of time when you are working on the command prompt. However, they are often overlooked.
\n
\n\tBasically, the PushD/PopD commands are used to maintain a history list of directory paths in what is called a directory stack. In addition, these commands function like the Change Directory (CD) command.
\n
\n\tThe syntax for the PushD command is:
\n
\n\tpushd [path]
\n
\n\tWhen you use it, the PushD command stores the current path in the directory stack and then immediately changes to the specified path. When you use the PopD command, it retrieves the path at the top of the stack and changes to that path.
\n
\n\tFor example, if you are currently in the C:\\Users\\Greg\\Documents directory and you type the command:
\n
\n\tpushd c:\\users\\public
\n
\n\tThen the C:\\Users\\Greg\\Documents path is stored in the directory stack and the current directory becomes C:\\Users\\Public. When you are done working in the C:\\Users\\Public directory, you just type:
\n
\n\tpopd
\n
\n\tWhen you do, the C:\\Users\\Greg\\Documents path is retrieved from the directory stack and the current directory becomes C:\\Users\\Greg\\Documents.
\n
\n\tImage by Greg Shultz for TechRepublic.