Solved

Get list of local disk drives from batch script

Posted on 2004-09-28
6
945 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now