Computing.Net > Forums > Programming > List Current Drives

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

List Current Drives

Reply to Message Icon

Name: Inj3cti0n
Date: June 29, 2009 at 02:15:45 Pacific
OS: Microsoft Windows XP Professional
CPU/Ram: 3.192 GHz / 3070 MB
Product: Dell / Dell dxp051
Subcategory: Batch
Comment:

hey again,

How do I echo out a list of currently active drives on the computer?



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: June 29, 2009 at 02:39:35 Pacific
Reply:

You can extend the list all the way to z.

=========================
@echo off & setLocal enableDELAYedexpansion

for %%a in (c d e f g h) do (
vol %%a: > nul 2>nul
if not errorlevel 1 (
echo %%a
)
)


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: Inj3cti0n
Date: June 29, 2009 at 02:42:47 Pacific
Reply:

Okay, Thanks.

I see this only outputs drives that are not only active but as do have something in them, any way to make it output the empty ones as well?


0

Response Number 3
Name: Mechanix2Go
Date: June 29, 2009 at 03:11:30 Pacific
Reply:

Nothing to do with full or empty. It puts out all letters which exist.


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 4
Name: Inj3cti0n
Date: June 29, 2009 at 03:15:04 Pacific
Reply:

I have a D drive and in the list, D isnt there.

As you can see in the pic below, I also have a I: drive as well, and its not listed either.

http://i44.tinypic.com/2eaqw50.png


0

Response Number 5
Name: Mechanix2Go
Date: June 29, 2009 at 03:27:03 Pacific
Reply:

hmmm... It lists my d drive, even after I removed the volume label.

You got me. Are the drives not shown NTFS?


=====================================
If at first you don't succeed, you're about average.

M2


0

Related Posts

See More



Response Number 6
Name: Inj3cti0n
Date: June 29, 2009 at 03:30:05 Pacific
Reply:

Umm lol, there DISC drives. For cd's and what not, Ill try putting a disk in and then seeing if it shows up in the list.


*EDIT*

Okay, yes, it only shows the active drives that ACTUALLY have something in them. (I think) I knw it doest list them if they are a empty disc drive, idk about a empty HDD.

:)


0

Response Number 7
Name: tonysathre
Date: June 29, 2009 at 09:10:57 Pacific
Reply:

fsutil fsinfo drives


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: List Current Drives

List current network drives in VB www.computing.net/answers/programming/list-current-network-drives-in-vb/7726.html

Linked Lists in C www.computing.net/answers/programming/linked-lists-in-c/11729.html

Batch Coding - dir list & file exec www.computing.net/answers/programming/batch-coding-dir-list-amp-file-exec/13530.html