Fixing cd to change drive in cmd | Generated by AI

Home 2026.07

Question: In Windows cmd, cd E:\ only prints E:\ but doesn’t actually switch the current drive/directory — how to fix?

Answer: cd alone doesn’t change drives in cmd.exe — it only changes directory within the current drive. To also switch drives, use /d:

cd /d E:\

Or the two-step way (this is the classic trick):

E:
cd \

Why: cmd tracks a separate “current directory” per drive letter. cd E:\ sets what E:’s current dir would be, but since you’re still on C:, nothing visibly changes — that’s why it just echoes E:\ back at you (that’s actually cd with no dir arg after the drive letter, just confirming). cd /d forces both the drive switch and the directory change at once.

References:


Generated by AI. Curating and sharing still takes effort. If you find it useful, feel free to donate. WeChat: @lzwjavaWeChat QR · X: @lzwjava · Say hi 👋

Back Donate