MS DOS Files and directories

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).

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « MS DOS Files and directories », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!