MS DOS Files and directories

October 2016

Files in MS DOS

In a computers data is stored in files. When you run a program, MS-DOS processes the data stored in the file and passes it to the system.
In MS-DOS a file can be any size, however the file name is more restricted, it can only have a maximum length of 8 characters plus 3 for the extension.

Furthermore, the files can only contain the following characters:

  • letters A to Z
  • numbers 0 to 9
  • the following special characters: $~! # % & - { } ( ) @ ' _ ^

Thus filenames must not contain:

  • spaces
  • commas
  • backslash
  • dot (apart from the dot that separates the name and the extension)

nor can they contain any of the following list of reserved names:

  • CLOCK$
  • CON
  • AUX
  • COM1
  • COM2
  • COM3
  • COM4
  • LPT1
  • LPT2
  • LPT3
  • NUL
  • PRN

Organising files in directories or folders

Depending on its size a hard drive may contain several thousands of files. However, the more files there are, the more difficult it is to manage them, this is when we need to store them in directories In MS-DOS, directory names are also subject to the same name restrictions as files (8 characters for the name, and an extension with 3 characters).

Related :

Microsoft DOS: Archivos y directorios
Microsoft DOS: Archivos y directorios
Dateien und Verzeichnisse
Dateien und Verzeichnisse
Fichiers et répertoires
Fichiers et répertoires
File e cartelle
File e cartelle
Ficheiros e directórios
Ficheiros e directórios
This document entitled « MS DOS Files and directories » from CCM ( is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.