edainworks.com :: VGR :: get the volume ID of a given device on the (Windows) server.

Run :
the Volume ID of C: is

Code :
// getvolumeID.php : get any volumeID
//VGR21082009 ADDed code et enrobage

$drive='C:'; // adapt to your needs
// prepare command
$syscmd="dir $drive";
// execute, get results
if ($fp) { // ok
  // read 
  while ((!feof ($fp))and $continue) {
    $buffer = fgets($fp, 4096);
    $continue=(strpos($buffer,'-')===FALSE); // the volumeID is the first that may contain a dash
  // close
  // extract information
  $expl=explode(' ',$buffer);
  // display
  echo "the Volume ID of $drive is $poubStr<BR>";
} else echo "the command '$syscmd' could not be executed";

Vincent Graux (VGR) for European Experts Exchange and Edažn Works  back to list of test scripts
Last update 2024-05-13 15:33:52