I just want to ask how do I access other drives in my computer using the command line. For example I would like to access the files in my flash drive how do I do it? I tried to use the change directory command ( cd <drive name>) but I cant access it..thanks ...^_^

Dani AI

Generated

asked how to reach files on another drive from the command prompt. Several correct, simple replies were posted — and pointed out the usual drive-switching behavior and added how to change drive and folder in one step. The suggestions are fine for normal use; the gaps are what to try when the flash drive does not appear or when you need alternative ways to access a path from scripts.

If the flash drive is missing inside CMD, inspect Disk Management to confirm the volume is present and has a drive letter or is not offline. On most Windows versions Disk Management is the GUI place to assign letters, bring a volume online or see partition problems; open it from Computer Management or run the Disk Management tool directly (see Disk Management (Microsoft Docs)). If a device driver problem is suspected, check Device Manager.

When a letter or mount point is not convenient, there are other command-line options:

diskmgmt.msc

To map a local folder to a drive letter for easier scripting, use the subst utility. For temporary access to a UNC share (server path) and automatic mapping to a drive letter, the pushd command is handy. For mounting volumes into empty NTFS folders or advanced volume configuration, mountvol (and diskpart for persistent changes) are the right tools. See the Microsoft docs for subst, pushd and mountvol for exact usage and caveats.

A few practical tips: some operations require administrative rights; Windows will not show files on filesystems it cannot read (e.g., native Linux filesystems) without third‑party drivers; and for portable batch files prefer absolute paths or the pushd/subst approach so the script does not depend on a previously set current-directory or drive letter.

Recommended Answers

All 12 Replies

c:
d:
e:
f:
... consult 1st grafe alphabet textbook for the rest

c:
d:
e:
f:
... consult 1st grafe alphabet textbook for the rest

somehow i don't think thats the correct answer !

if your drive you are trying to access is F:
then type F: in the command line and press enter

somehow i don't think thats the correct answer !

somehow I think you are wrong

Dima has given you the way to start Explorer in the drive of your choice.
If you want to explore the drive from the command line then you do this....
Start, run, type cmd, and enter.
Okay, you are now in a [black] command window, the prompt will be C:\Docs and Setts\User>
To go to another drive eg E:\, you just type...
cd /d e:\ [to change drives you must use the /d switch]
If you then type ..
cd /d c: you will end up back in the D and S\User spot... cd /d c:\ will put you into c: root.
Type... dir |more to get a directory or file list in the drive of your choice.
Type ... dir /? to get a helping hand... or /? with any command...

to go to any drive letter in cmd, typing the drive letter and a colon is enough

True, dima. Ah well, now he also knows how to change drive and directory at the same time as well.

I mean the '/d' switch is useless uless you're writing a very complex script, and those usually use absolute paths anyway

If you were in one directory, say E:\Program Files and wanted to jump to D:\Scratch Pad you would have to use the /d switch in a command like..
cd /d d:\scratch pad otherwise the cmd would be ignored.

yup, that is true :)

I bet he gave up reading this thread anyway... sigh...

LOL :) quite possible

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.