I'm using cmd.exe
(C:\WINDOWS\System32\cmd.exe) and I have to change my current directory to "D:\temp" i.e. temp folder in the D drive.
When I try to cd
nothing happens.
C:\> cd D:\temp
C:\>
I don't know what else to do here. Even pressing tab
key does not give any hints. I have never got the reason to use cmd.exe until now when I have to. I mostly use Linux for development.
If this helps: I'm on a remote login to another computer and D:\temp
in on the remote machine, but so is C:\
where I have opened the terminal (cmd.exe).
Change Directories Using the Drag-and-Drop Method If the folder you want to open in Command Prompt is on your desktop or already open in File Explorer, you can quickly change to that directory. Type cd followed by a space, drag and drop the folder into the window, and then press Enter.
For instance, if you wanted to change the drive from C: to D:, you should type: d: … and then press Enter on your keyboard. To change the drive and the directory at the same time, use the cd command, followed by the /d switch.
The "cd" command changes the directory, but not what drive you are working with. So when you go "cd d:\temp", you are changing the D drive's directory to temp, but staying in the C drive.
Execute these two commands:
D:
cd temp
That will get you the results you want.
Another alternative is pushd
, which will automatically switch drives as needed. It also allows you to return to the previous directory via popd
:
C:\Temp>pushd D:\some\folder
D:\some\folder>popd
C:\Temp>_
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With