Microsoft KB Archive/67043

Rules and Acceptable Characters for MS-DOS Filenames PSS ID Number: Q67043 Article last modified on 09-13-1993 PSS database name: O_MSDOS

3.30 3.30a 4.00 4.01 5.00

MS-DOS

Question:

Where can I find the “official” definition of MS-DOS filenames, specifically, which characters are and aren’t allowed, and so on? I am writing a function to parse a string and want to make sure it contains a valid DOS filename.

Response:

The “Microsoft MS-DOS User’s Guide” versions 3.3 and 4.01 manuals contain a list of valid filename characters; however, this list is not complete. The information is correctly documented in the “Microsoft MS-DOS User’s Guide and Reference” version 5.0 manual.

The following are the official rules for creating MS-DOS filenames:

  Filenames must be no longer than eight characters.   Filenames must contain only the following characters: A-Z Uppercase letters a-z Lowercase letters 0-9 Numbers $ Dollar sign % Percent sign ’ Apostrophe ` Opening single quotation mark   Hyphen @ At sign { Left brace } Right brace ~ Tilde ! Exclamation point # Number sign ( Left parenthesis ) Right parenthesis & Ampersand _ Underscore ^ Caret   Filenames must not contain spaces, commas, or periods (except the period that separates the name from the extension).   Filenames must not use the following names: CLOCK$, CON, AUX, COM, LST, NUL, and PRN (these are names reserved by MS-DOS). 

Additional reference words: 3.30 3.30a 4.00 4.01 5.00 illegal invalid noupd

Copyright Microsoft Corporation 1993.