Accessing DOS variables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Does anybody know how to grab the text associated with the results you get
when you run the VOL command at a DOS prompt?

Thanks,
 
You could run a batch command that pipes it into a file (VOL > myfile.txt),
and then read the text file (using File Open and Line Input)

Alternative, use the GetVolumeInformation API. Randy Birch has an example of
how to do this at http://vbnet.mvps.org/code/disk/volumelabel.htm
(Obligatory Warning: Randy's site is aimed at VB programmers. There are
significant differences between the controls available for forms in VB and
in Access. As a result, many of his samples will not port directly into
Access. I think this may be one of those. Randy uses Print commands to write
to the form, and I don't believe that works in Access. However, you can see
how he gets the values that he's writing to the form)
 
Back
Top