Solved

Get list of local disk drives from batch script

Posted on 2004-09-28
6
947 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

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)

Question has a verified solution.

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

Suggested Solutions

If you build your web application in Visual Studio you'll get at least a few binaries, or .DLL, files in your bin folder. However, there is more compiling to be done. Normally this would happen when an ASP.NET resource within the web site is request…
We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
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…

816 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

7 Experts available now in Live!

Get 1:1 Help Now