Lock a Disk Volume in MS-DOS 6.22
In MS-DOS 6.22, the built-in utility used to lock a disk volume against write attempts and unauthorized modifications is VSAFE. Originally licensed from Central Point Software as part of the Microsoft Anti-Virus suite, VSAFE is a terminate-and-stay-resident (TSR) program that actively monitors system operations and provides hardware-level and filesystem-level write-protection for disk volumes.
Using VSAFE to Lock Volumes
VSAFE operates in the background, intercepting interrupt calls (specifically INT 13h BIOS disk services and INT 21h DOS services) that attempt to modify data on storage drives.
To load and configure VSAFE for volume protection:
- Launch the Utility: Execute
VSAFEfrom the command line or add it to yourAUTOEXEC.BATfile. - Access the Interface: Press the default hotkey
(
Alt + V) to open the VSAFE configuration window. - Enable Write Protection: Select the option to write-protect the hard disk (Option 7: "Protect Hard Disk" or Option 3 depending on configuration). When activated, VSAFE blocks any program from altering the partition table, boot sector, file allocation table (FAT), or directory structure of the disk volume.
Any process attempting to write data, alter system structures, or format the drive while this protection is active will be blocked, and MS-DOS will display an alert prompting the user to allow or deny the action.
Alternative Method: DriveSpace Volume Locking
For systems utilizing MS-DOS 6.22's built-in disk compression tool,
DriveSpace (DRVSPACE.EXE), an entire
volume can also be locked using the standard ATTRIB
command:
- Locate the Compressed Volume File (CVF), typically named
DRVSPACE.000, residing on the uncompressed host drive. - Apply the read-only file attribute to the CVF:
ATTRIB +R H:\DRVSPACE.000 - Upon reboot or remounting, MS-DOS 6.22 mounts the associated drive letter as an entirely read-only volume, physically preventing any file creation, modification, or deletion.
Note on the MS-DOS
LOCK Command
The standalone LOCK and UNLOCK commands
often associated with DOS volume locking were not introduced in MS-DOS
6.22. Microsoft introduced those commands in MS-DOS 7.0 (distributed
with Windows 95) to manage direct disk access for FAT16 and FAT32
partitions. For standard MS-DOS 6.22 installations,
VSAFE and DriveSpace CVF
write-protection remain the native tools for securing a disk
volume against changes.