Highest Disk Number

S

sanindbang

Hi,
Is there anyway to know the higest disk number in the window
2000 server.
More in detail:
I have storage subsystems(EVA, XP) connected to the server
I am trying to get the disk numbers of all the disks by CreateFile(
passing \\PHYSICALDRIVExx , xx incrementing from 0. I dont want to loo
through maximum supported disks by windows 2000 which is 255(HBA limi
also) even if I have only 5 disks. To stop looping when CreateFile()
fails, incase of the disk numbers not in sequence this wont cover fo
all the disks.

I appreciate if somebody can help me.


Regards,
sanin


-
sanindban
 
M

Mark-Allen Perry

Ok, maybe outside your programming language but could you use VBS?

This script lists all the known disks and display most of their information:

on error resume next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colDisks = objWMIService.ExecQuery ("Select * from Win32_LogicalDisk")

For each objDisk in colDisks
Wscript.Echo "Compressed: " & vbTab & objDisk.Compressed
Wscript.Echo "Description: " & vbTab & objDisk.Description
Wscript.Echo "DeviceID: " & vbTab & objDisk.DeviceID
Wscript.Echo "DriveType: " & vbTab & objDisk.DriveType
Wscript.Echo "FileSystem: " & vbTab & objDisk.FileSystem
Wscript.Echo "FreeSpace: " & vbTab & objDisk.FreeSpace
Wscript.Echo "MediaType: " & vbTab & objDisk.MediaType
Wscript.Echo "Name: " & vbTab & objDisk.Name
Wscript.Echo "QuotasDisabled: " & vbTab & objDisk.QuotasDisabled
Wscript.Echo "QuotasIncomplete: " & vbTab & objDisk.QuotasIncomplete
Wscript.Echo "QuotasRebuilding: " & vbTab & objDisk.QuotasRebuilding
Wscript.Echo "Size: " & vbTab & objDisk.Size
Wscript.Echo "SupportsDiskQuotas: " & vbTab & _
objDisk.SupportsDiskQuotas
Wscript.Echo "SupportsFileBasedCompression: " & vbTab & _
objDisk.SupportsFileBasedCompression
Wscript.Echo "SystemName: " & vbTab & objDisk.SystemName
Wscript.Echo "VolumeDirty: " & vbTab & objDisk.VolumeDirty
Wscript.Echo "VolumeName: " & vbTab & objDisk.VolumeName
Wscript.Echo "VolumeSerialNumber: " & vbTab & _
objDisk.VolumeSerialNumber
wscript.echo
Next

You didn't mention a language. You might also check the scripting area to see if there are other scripts.

http://www.microsoft.com/technet/community/scriptcenter/default.mspx

--
And always try the MS KB first before posting.
The answer is probably already posted.
MS KB: http://support.microsoft.com/default.aspx?scid=fh;EN-US;KBHOWTO
----
Mark-Allen Perry
ALPHA Systems
Marly, Switzerland
mark-allen_AT_mvps_DOT_org


Hi,
Is there anyway to know the higest disk number in the windows
2000 server.
More in detail:
I have storage subsystems(EVA, XP) connected to the server.
I am trying to get the disk numbers of all the disks by CreateFile()
passing \\PHYSICALDRIVExx , xx incrementing from 0. I dont want to loop
through maximum supported disks by windows 2000 which is 255(HBA limit
also) even if I have only 5 disks. To stop looping when CreateFile()
fails, incase of the disk numbers not in sequence this wont cover for
all the disks.

I appreciate if somebody can help me.


Regards,
sanind
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top