Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Can anyone provides me details of why Windows does nto allow to create file/folders with below names?

  • PRN
  • AUX
  • NUL
  • LPT1
  • COM1
  • Potential drive letter - A: to Z:
  • Other characters (such as <(less than), >(greater than), :(colon), "(double quote), /(forward slash), \(backslash), |(vertical bar or pipe), ?(question mark), *(asterisk)
share|improve this question
    
Check the answers to this post on StackOverflow.com: stackoverflow.com/questions/62771/… –  JBRWilkinson Jul 1 '10 at 11:48
    
Nota bene: This likely only applies to file names as used by the Windows API as opposed to restrictions imposed by NTFS. You can create such files just fine when you're creating them in POSIX namespace – the file system couldn't care less. –  Joey Jul 1 '10 at 16:45
    
You can create PRN, AUX, and the rest: \\.\C:\blah\nul –  grawity Jul 1 '10 at 17:58

2 Answers 2

Full details of what is allowed from MSDN:

http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx

  • Use a period to separate the base file name from the extension in the name of a directory or file.

  • Use a backslash () to separate the components of a path. The backslash divides the file name from the path to it, and one directory name from another directory name in a path. You cannot use a backslash in the name for the actual file or directory because it is a reserved character that separates the names into components.

  • Use a backslash as required as part of volume names, for example, the "C:\" in "C:\path\file" or the "\server\share" in "\server\share\path\file" for Universal Naming Convention (UNC) names. For more information about UNC names, see the Maximum Path Length Limitation section.

  • Do not assume case sensitivity. For example, consider the names OSCAR, Oscar, and oscar to be the same, even though some file systems (such as a POSIX-compliant file system) may consider them as different. Note that NTFS supports POSIX semantics for case sensitivity but this is not the default behavior. For more information, see CreateFile.

  • Volume designators (drive letters) are similarly case-insensitive. For example, "D:\" and "d:\" refer to the same volume.

  • Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following:

    • The following reserved characters:

      • < (less than)
      • > (greater than)
      • : (colon)
      • " (double quote)
      • / (forward slash)
      • \ (backslash)
      • | (vertical bar or pipe)
      • ? (question mark)
      • * (asterisk)
    • Integer value zero, sometimes referred to as the ASCII NUL character.

    • Characters whose integer representations are in the range from 1 through 31, except for alternate streams where these characters are allowed. For more information about file streams, see File Streams.

    • Any other character that the target file system does not allow.

  • Use a period as a directory component in a path to represent the current directory, for example ".\temp.txt". For more information, see Paths.

  • Use two consecutive periods (..) as a directory component in a path to represent the parent of the current directory, for example "..\temp.txt". For more information, see Paths.

  • Do not use the following reserved device names for the name of a file:

    CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension; for example, NUL.txt is not recommended. For more information, see Namespaces.

  • Do not end a file or directory name with a space or a period. Although the underlying file system may support such names, the Windows shell and user interface does not. However, it is acceptable to specify a period as the first character of a name. For example, ".temp".

share|improve this answer

Also, neither a space nor a period can be used at the end of a name. Further, files cannot have the following reserved device names: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Note that the case does not matter in Windows.

There's more information you may find useful on the page that came from (Source).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.