none
The specified device name is invalid RRS feed

  • Question

  • I'm using Windows 7 Ultimate RTM and I'm having the following issue,

    I cannot rename the folder 'ConAir.1997' to 'Con.Air.1997'; I get this
    Rename popup window, 'The specified device name is invalid'
    Sunday, September 20, 2009 3:14 PM

Answers

  • We cannot create a folder named any of these keywords : CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.

     

    these keywords are used by Windows internally and are reserved Keywords. CON was used for CONSOLE, PRN for PRINTER, LPT’s for PARALLEL PORTS etc.

    Tuesday, September 22, 2009 2:25 AM
    Moderator
  • Hi neilkpd,

    Please 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 by an extension, for example, NUL.tx7.

    These words mean devices behaving like files in some ways and are therefore reserved. Folders obey filename rules. But you can trick the system using a low level tool and create an unusable file or folder. You could use it for a copy protection for instance.

    If you really need a folder named CON, then use "CON<alt-255>". This works and looks like CON because Alt-255 looks like space but is different. Please note: we should press 255 keys on Numeric keypad.

    Meanwhile, we can use command "md CON\" to create a folder named CON.

    In addition, I would like to share more information with you. Please refer to File Names, Paths, and Namespaces.

    Hope the above information is useful for you.

    Thanks,
    Candice

    Tuesday, September 22, 2009 7:04 AM

All replies

  • what happens if instead of a "." (period) between "Con" and "Air" you use a "-" (hyphen) or a "_" (underscore)? 

    I don't think you can have two "." in a directory name.
    Sunday, September 20, 2009 5:40 PM
  • The "-" (hyphen) or a "_" (underscore) works fine.

    I have 1-7 "." within other titles and don't have any problems.
    Sunday, September 20, 2009 10:23 PM
  • Multiple "."s are not a problem.

    I think it has something to do with CON being a reserved name, such as COM1, etc.
    Monday, September 21, 2009 12:01 AM
  • We cannot create a folder named any of these keywords : CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.

     

    these keywords are used by Windows internally and are reserved Keywords. CON was used for CONSOLE, PRN for PRINTER, LPT’s for PARALLEL PORTS etc.

    Tuesday, September 22, 2009 2:25 AM
    Moderator
  • We cannot create a folder named any of these keywords : CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.


    Apparently you can't even use them for the base name of a file.
    Tuesday, September 22, 2009 3:58 AM
  • Hi neilkpd,

    Please 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 by an extension, for example, NUL.tx7.

    These words mean devices behaving like files in some ways and are therefore reserved. Folders obey filename rules. But you can trick the system using a low level tool and create an unusable file or folder. You could use it for a copy protection for instance.

    If you really need a folder named CON, then use "CON<alt-255>". This works and looks like CON because Alt-255 looks like space but is different. Please note: we should press 255 keys on Numeric keypad.

    Meanwhile, we can use command "md CON\" to create a folder named CON.

    In addition, I would like to share more information with you. Please refer to File Names, Paths, and Namespaces.

    Hope the above information is useful for you.

    Thanks,
    Candice

    Tuesday, September 22, 2009 7:04 AM
  • Excellent reference, Candice.

    But it does not say that you cannot use a filename such as CON.AIR.  It just recommends against it:

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

    Tuesday, September 22, 2009 9:47 PM
  • Please Please Please !!!!!

    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

    If You Did You Will Put Your Selfe Under Terms responsibilty.

     

    Thread Closed!

    Wednesday, May 5, 2010 12:53 AM
  • Candice,

    I understand that Windows/DOS used to have purpose for these reserved names of internal devices and commands back in the old computing days, but why do they still exist now? I work on websites quite regularly, many of which use Content Management Systems that have "con.php" files holding database connection information. How do you expect me to be able to keep a local working copy downloaded on my Windows PC if I cannot mirror the working directory of the website because Windows doesn't allow the names?

    I can't just simply modify the entire CMS, nor should I have to because it's universal on every Linux or Mac distribution. No one should have to just because Windows is programmed to reserve special file and folder names to operate. It'd be nice if Microsoft fixed this in an Operating System Update, or at least in Windows 7. I continue to use Windows strictly because it runs games, but I'm really tempted to ditch it and it's expensiveness for a Linux flavor because of many bugs like this one. And yes, I consider not being able to name files anything I want (within the standard ASCII character set) a bug. A HUGE Bug.

    So please, consider this request and think about all situations when you design an OS next time.

    Thanks, Erik Wright
    Independent Web Developer


    • Edited by Erik Wright Monday, April 30, 2012 6:23 PM typo
    Monday, April 30, 2012 6:22 PM
  • Candice,

    I understand that Windows/DOS used to have purpose for these reserved names of internal devices and commands back in the old computing days, but why do they still exist now? I work on websites quite regularly, many of which use Content Management Systems that have "con.php" files holding database connection information. How do you expect me to be able to keep a local working copy downloaded on my Windows PC if I cannot mirror the working directory of the website because Windows doesn't allow the names?

    I can't just simply modify the entire CMS, nor should I have to because it's universal on every Linux or Mac distribution. No one should have to just because Windows is programmed to reserve special file and folder names to operate. It'd be nice if Microsoft fixed this in an Operating System Update, or at least in Windows 7. I continue to use Windows strictly because it runs games, but I'm really tempted to ditch it and it's expensiveness for a Linux flavor because of many bugs like this one. And yes, I consider not being able to name files anything I want (within the standard ASCII character set) a bug. A HUGE Bug.

    So please, consider this request and think about all situations when you design an OS next time.

    Thanks, Erik Wright
    Independent Web Developer


    I think you are right.  After all, under NTFS you can create files that have the same name except for different case (as long as Windows and the NTFS file system are set that way).  These names should no longer be sacred.
    Monday, April 30, 2012 11:11 PM