Basic Program to Change Floppy Disk Volume Label in MS-DOS
Solution
SUMMARY
The following code example demonstrates how to retrieve and modify the volume label from an MS-DOS formatted floppy disk. (Disks formatted by MS-DOS versions 4.0 and later receive an optional volume label in the boot sector of the disk). The example uses Interrupt 25 hex to do an absolute disk read of the first sector on the disk (the boot sector). After the sector has been read into memory, the disk volume label can be found and modified at offsets 2C hex to 37 hex of that memory area. The sector is then rewritten to the disk using Interrupt 26 hex (Absolute Disk Write).
This information applies to Microsoft QuickBasic versions 4.0, 4.0b, and 4.5 for MS-DOS; Microsoft Basic Compiler versions 6.0 and 6.0b for MS-DOS; and Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS.