$dinfo = "Win32_LogicalDisk";
function driveinfo($vComputerName, $vClass) {
$objLocator = new COM("WbemScripting.SWbemLocator");
if($vComputerName == "") $objService = $objLocator->ConnectServer();
else $objService = $objLocator->ConnectServer($vComputerName);
$objWEBM = $objService->Get($vClass);
$objProp = $objWEBM->Properties;
$objMeth = $objWEBM->Methods;
echo "</table><BR>" . $vComputerName . " - Drive Information<BR><table border=1><tr><td>Drive Letter</td><td>Drive Type</td><td>Free Space</td><td>Total Space</td></tr>";
foreach($objMeth as $methItem)
$objWEBMCol = $objWEBM->Instances_();
foreach($objWEBMCol as $objItem) {
if ($objItem->DriveType == 3) {
foreach($objProp as $propItem) {
$tmp = $propItem->Name;
if ($tmp == "Caption") {
echo "<td style='border-top-width: thin; border-left-width: thin;
border-bottom-width: thin; border-right-width: thin'>" . $objItem->$tmp . "</td>";
} else
if ($tmp == "DriveType") {
echo "<td style='border-top-width: thin; border-left-width: thin;
border-bottom-width: thin; border-right-width: thin'>Physical Hard Disk</td>";
} else
if ($tmp == "FreeSpace") {
echo "<td style='border-top-width: thin; border-left-width: thin;
border-bottom-width: thin; border-right-width: thin'>" . $objItem->$tmp . "</td>";
} else
if ($tmp == "Size") {
echo "<td style='border-top-width: thin; border-left-width: thin;
border-bottom-width: thin; border-right-width: thin'>" . $objItem->$tmp . "</td>";
}
if ($tmp == "") {
echo "<td style='border-top-width: thin; border-left-width: thin;
border-bottom-width: thin; border-right-width: thin'>" . $objItem->$tmp . "</td>";
}
}
}
echo "</tr>";
}
echo "</table><BR>";
}
driveinfo("systemname", $dinfo);
I know you are looking for the nix side, but this may be helpful.