Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Get list of local disk drives from batch script

Posted on 2004-09-28
6
948 Views
Last Modified: 2008-02-01
Greetings;

I need to be able to generate a list of local disk drives that are attached to a system. I need to run this from a batch file, then I will perform various operations on the disk drives in the list.

I have done a bit of research on this but cannot find a way to do this. Please help a UNIX admin solve this Windows issue.

Thank you

jvossler
0
Comment
Question by:jvossler
  • 2
  • 2
  • 2
6 Comments
 
LVL 3

Expert Comment

by:zamoti
ID: 12171261
You could try the "map" command, but it gives you a lot of output.  I'm guessing that you need to run commands against the output?  I saw your other post about command-line mailing; related?  If you let us in on the entire story perhaps we could offer more help.

0
 
LVL 86

Expert Comment

by:jkr
ID: 12171268
'msinfo32.exe' can do that. Type 'msinfo32 /?' on the command line for more options. It should be like

msinfo32 /category ComponentsStorageDrives /report drives.txt
0
 

Author Comment

by:jvossler
ID: 12171662
Mt two questions are not related. In this one I need to periodically test several email alliases that the company has set up. We found that the web administartor (another company) had inadvertantly killed a couple of the many email aliases. We are just attempting to test these periodically.

I did not have a path to msinfo32 but I will begin testing today. Running from the command line gives a pop up window. I have not yet been able to generate a report on disk

I also have not been able to locate the map command. I assume map.exe. A search of the system did not turn up this file and command line queries returned nothing. Can you let me know what the path is to the map command?

jvossler
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 86

Expert Comment

by:jkr
ID: 12171714
>>I did not have a path to msinfo32

Try winmsd as an alias for msinfo32.
0
 
LVL 3

Accepted Solution

by:
zamoti earned 500 total points
ID: 12174458
I found one that is probably more what your looking for:

fsutil fsinfo drives

All one command.  Yeah, that does it.  

C:\>fsutil fsinfo drives

Drives: A:\ C:\ D:\ E:\ F:\ G:\ I:\ L:\ M:\ N:\ O:\ P:\ R:\ X:\ Z:\
0
 

Author Comment

by:jvossler
ID: 12174629
Zamoti

Although I need the names of only local devices the fsutil command with the "fsinfo drivetype" parameters will allow me to determine if the device is local or remote. I can add logic for this in my batch file. This will get me what I am looking for.

Thank muchly

Happy computing

jvossler

 
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the time we are in fix when all of sudden our systems behave weirdly.  Such problems cost time and effort... so it's best to take some preventive actions so that we can avoid such issues or overcome such problems more easily. Preventive M…
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question