how to list all drives on a computer windows 7

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Rileyh
Posts: 147
Joined: 01 Sep 2011 03:54
Location: Perth, Western Australia

how to list all drives on a computer windows 7

#1 Post by Rileyh » 12 Oct 2011 01:11

Hi,
Could someone post a command that lists all current drives on the computer in windows 7

Thanks,
Rileyh

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: how to list all drives on a computer windows 7

#2 Post by Ed Dyreen » 12 Oct 2011 01:14

'

Code: Select all

for %%! in (

   A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

) do    if exist "%%!:" (
   ::
   echo. exist '%%~!:'
)

Rileyh
Posts: 147
Joined: 01 Sep 2011 03:54
Location: Perth, Western Australia

Re: how to list all drives on a computer windows 7

#3 Post by Rileyh » 12 Oct 2011 01:17

THanks for such a quick reply!

Rileyh
Posts: 147
Joined: 01 Sep 2011 03:54
Location: Perth, Western Australia

Re: how to list all drives on a computer windows 7

#4 Post by Rileyh » 12 Oct 2011 01:18

It worked!
THank you. I have been working on this issue for 2 days! (because i can't get the "for" command working and i don't understand it)


Regards,
RIleyh

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: how to list all drives on a computer windows 7

#5 Post by Ed Dyreen » 12 Oct 2011 01:22

'
I think you are going to like this, it's a beginners tutorial :mrgreen:
http://www.allenware.com/icsw/icswidx.htm

Rileyh
Posts: 147
Joined: 01 Sep 2011 03:54
Location: Perth, Western Australia

Re: how to list all drives on a computer windows 7

#6 Post by Rileyh » 12 Oct 2011 01:26

Thanks for the tutorial.
While your there, could you tell me how to do this whole section in my batch file.
I want the person to choose which drive to make a file in. It lists the drives (my previous question!), they choose one, and then the batch sets their answer as a variable. Then, it changes to the directory they inputted and makes the file there.

Could you tell me how to do so?

Thanks for the help,
Rileyh

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: how to list all drives on a computer windows 7

#7 Post by Ed Dyreen » 12 Oct 2011 16:20

'
While your there, could you tell me how to do this whole section in my batch file
....
Could you tell me how to do so?
Sure, are u going to pay me :lol:

No really, first of all, I don't know what section of batch ur talking about.

Post Reply