Accessing DOS variables

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,
 
D

Douglas J. Steele

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)
 
G

Guest

Douglas,

The API reference worked like a charm.

Thanks for pointing that site out to me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top