Make sure you're using the right syntax. As a leftover from MS-DOS times, changing drive and directory are two separate operations in the command-line shell.
For example, to go to T:\
, you first change the drive to T:
, then the directory to \
:
T:
cd \
In Windows NT, the cmd.exe
shell allows combining both operations again using the /d
option:
cd /d T:\
A bit more detail. When you run cd T:\
as in your own example, it does change the directory, just not the drive. In MS-DOS and DOS-based versions of Windows, each drive letter had its own separate "current directory", as explained in this post.
Windows NT only has one "current directory" per process; however, the command shell and its cd
command have to emulate the old behavior for compatibility reasons.
Does windows support any form of alias so I can make cd always use
cd /d
? – Jakob Bowyer – 2011-12-27T23:20:45.277In batch files, no. In interactive shells, yes - using
– user1686 – 2011-12-27T23:34:17.277doskey
. Also, you might find thepushd
/popd
command pair convenient; they don't require the separate steps.