Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win32 - is my disk striped

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Joined
Feb 6, 2002
Messages
1,851
Location
IL
Hi

I have failed to find using WMI if the given disk is striped or not.
Would anybody have any ide on this ?
Thanks


Long live king Moshiach !
 
show us how you tried, there may be die or warn exception that can be thrown in the even of failure.

Also state if you knew the disks to be striped in advance of the script running

--Paul

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Hi,

The code I used is :

use Win32::OLE('in');
use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;

my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n";
my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_DiskPartition", "WQL",
wbemFlagReturnImmediately | wbemFlagForwardOnly);

foreach my $objItem (in $colItems) {
&disp("DeviceID: $objItem->{DeviceID}\n");
&disp("Size: $objItem->{Size}\n");
if ($objItem->{Type} =~ /Logical Disk Manager/) {
$string = "Type: " . $objItem->{Type} . "\t-Striped !";
} else {
$string = "Type: " . $objItem->{Type};
}
print $string;
print "--------------------------------";
}

The thing is that checking for "Logical Disk Manager" does not seem to be enough.

Long live king Moshiach !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top