Tutorial by Examples

Format and Usage: echo %cd% %cd% is a system variable that contains the current directory path
Format: cd "<path>" Example: cd "C:\Program Files (x86)\Microsoft Office" cd is an abbreviation for chdir and the two commands behave in the exact same way. For the sake of consistency, cd will be used throughout this topic. To navigate to the directory one leve...
cd by itself will not allow a user to move between drives. To move to a different drive, the /d option must be specified. e.g. Moving from C:\Users\jdoe\Desktop to D:\Office Work cd /d "D:\Office Work"
Usage to list all folders and files in the current directory: dir A target directory can also be specified: dir C:\TargetPath When specifying a path with spaces, it must be surrounded by quotes: dir "C:\Path With Spaces"
Pushd "D:\Foo" Dir Popd Pushd will change the directory to the directory following (in this case D:\Foo. Popd returns back to the original directory.
Format: cd/ cd/ is set to change the current directory back to the root of the current drive

Page 1 of 1