The information in this article applies to:
SUMMARYChanging a drive's volume label involves the use of FCB (file control block) file processing, and therefore is not supplied with the C run-time libraries. However, one of the ways to do this is through MS-DOS Interrupt 21h calls for FCB file manipulation. MORE INFORMATION
Below is an assembly routine written with Microsoft MASM version 5.1
to change a drive's volume name. To do this, it first sets up an
extended FCB to allow for manipulating files with attributes. Offset 6
of the FCB is set to 8 (_A_VOLID defined in DOS.H) to specify a
volume. The old volume is searched for with "*.*" as a pattern and
deleted, then the volume is re-created with the new volume label
passed by the C caller. The function returns the error code supplied
from the MS-DOS application programming interface (API) that creates
the volume label.
The new volume label must be passed with 11 characters for the name.
Anything less MUST be padded with spaces.
Sample Code
Additional query words: kbinf 5.10
Keywords : |
Last Reviewed: January 7, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |