<?php
//
// getvolumeID.php : get any volumeID
//
//VGR10042003
//VGR21082009 ADDed code et enrobage
//
$drive='C:'; // adapt to your needs
// prepare command
$syscmd="dir $drive";
// execute, get results
$fp=popen($syscmd,'r');
if ($fp) { // ok
// read
$continue=TRUE;
while ((!feof ($fp))and $continue) {
$buffer = fgets($fp, 4096);
$continue=(strpos($buffer,'-')===FALSE); // the volumeID is the first that may contain a dash
}
// close
pclose($fp);
// extract information
$expl=explode(' ',$buffer);
$poubStr=$expl[count($expl)-1];
// display
echo "the Volume ID of $drive is $poubStr<BR>";
} else echo "the command '$syscmd' could not be executed";
//end
?>
for European Experts Exchange and Edaìn Works back to list of test scripts
Last update 2009-10-30 09:20:01
Copyright(©)(c) the respective authors. Licensed under the Creative Commons Attribution Share Alike 3.0 License
.
These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!