Rewrite System Files in MS-DOS 6.22

This article explains how to force MS-DOS 6.22 to rewrite core operating system files to an existing storage drive using the built-in SYS command. You will learn the exact syntax required, what files are transferred during the process, and how the command restores bootability to a drive without erasing user data or requiring a complete reformat.

The primary command used to rewrite system files to an existing storage medium in MS-DOS 6.22 is the SYS command. Unlike the FORMAT /S command, which wipes the entire disk before installing the operating system files, SYS replaces or installs the required startup files on an already formatted drive while leaving all existing non-system files intact.

Command Syntax

To rewrite the system files to a target drive, boot MS-DOS 6.22 from an alternate drive (such as a bootable floppy disk) and enter the following command at the prompt:

SYS [drive1:] drive2:
  • drive1: (Optional) Specifies the location of the source system files. If omitted, MS-DOS uses the current default drive as the source.
  • drive2: Specifies the target drive where the system files need to be rewritten (e.g., C:).

For example, to rewrite the system files to the primary hard drive from a boot floppy in drive A:, type:

SYS C:

If you are running the command from a subfolder or another drive and need to explicitly define both the source and target locations:

SYS A:\ C:

What the Command Does

When executed, the SYS command performs two critical actions:

  1. Copies System Files: It transfers the hidden files IO.SYS and MSDOS.SYS, along with the command interpreter COMMAND.COM, from the source medium to the root directory of the target drive. If older or corrupted versions of these files already exist on the target, SYS overwrites them.
  2. Rewrites the Boot Sector: It updates the drive's Volume Boot Record (VBR) with the bootstrap code necessary to locate and load IO.SYS during the power-on self-test (POST).

Execution Requirements

For the SYS command to succeed in MS-DOS 6.22:

  • The target drive must already be partitioned with FDISK and formatted with the FAT16 file system.
  • There must be sufficient contiguous free space at the beginning of the target drive's data area to accommodate IO.SYS and MSDOS.SYS. If the target drive is too fragmented, you may need to run DEFRAG or free up space before running SYS.
  • Upon successful completion, MS-DOS displays the message System transferred, confirming the drive is now bootable.