Return to site

How to go back in cmd

broken image
broken image

Now you can go up a directory level by typing. We will also need a small helper batch file to remember the directory changes and to ignore changes to the same directory: mycd.bat: offĪnd a small aliases file showing what to do to make it all work: aliases: cd=C:\tools\mycd.bat $* %SystemRoot%\System32\doskey.exe /macrofile=c:\tools\aliases Here is a simple batch file to change directories to the first parameter (%1) passed in, and to remember the initial directory by calling pushd %1. Run cmd.exe using the /k switch and a starting batch file that invokes doskey to use an enhanced versions of the cd command.