On Thu, Sep 12, 2013 at 4:07 PM, Gareth Howell <
[hidden email]> wrote:
> The problem I have is getting the
> CD name from the CD. Using getDirectory I can map to the drive (e.g. E:
>
Since you're using Windows and mention E: drive as your CD drive, use:
exec("cmd /C vol E:");
The ImageJ log window will show the string result. To process the
returned string for the label you could do something like this:
cd_drive = "E"
// Run Windows' `vol` command.
vol = exec("cmd /C vol " + cd_drive + ":");
// Check if it has a label.
label = "none"
if (indexOf(vol, " has no label.") == -1)
{
start = indexOf(vol, " is ") + lengthOf(" is ");
end = indexOf(vol, "\n");
label = substring(vol, start, end);
}
print(cd_drive + ": Label = " + label);
> Gareth
Pariksheet
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html