XP: Can you create a folder called "con" ?

Discussion in 'Windows Operating Systems' started by DefoBryso, Nov 6, 2005.

  1. DefoBryso

    DefoBryso Member

    Joined:
    Mar 1, 2002
    Messages:
    751
    Location:
    Sydney
    Try it, you can't create a folder called "con" , why the heck is that?
    Not really an issue, someone at work asked me if i could and spun me out that it couldn't be done. Any know why?
     
  2. nux

    nux Member

    Joined:
    Jan 20, 2002
    Messages:
    16,780
    Location:
    Melbourne
    The following reserved device names cannot be used as the name of a file:

    CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.

    http://kerneltrap.org/node/5772

    *Shrug*
     
    Last edited: Nov 6, 2005
  3. mercho

    mercho Member

    Joined:
    May 7, 2004
    Messages:
    1,502
    Location:
    Bathurst, NSW
    mmm interesting...learn something new everyday :)
     
  4. crix75

    crix75 Member

    Joined:
    Jan 16, 2003
    Messages:
    887
    Location:
    Adelaide, SA
    It's partly due to a DOS hangover, when it was more common to redirect various outputs to places other than the screen.

    eg You could create a basic batch file by:
    C:\>copy con test.bat
    :loop
    echo Batch File Test
    goto loop
    ^Z [Ctrl-Z]

    And it's done.. You could/can print text files by: copy filename.txt >lpt1 (or prn or comX)

    There were al sorts of other uses for it, these are just a couple I can remember..
     
  5. noboundaries-au

    noboundaries-au Member

    Joined:
    Jan 9, 2005
    Messages:
    7,571
    Location:
    Canberra, ACT
    This man speaks truth... :thumbup:
     
  6. wwwww

    wwwww Member

    Joined:
    Aug 22, 2005
    Messages:
    5,635
    Location:
    Melbourne
    There was a directory in the root directory of the drive where your OS is called con back in win98. If you shelled c:\con\con your comp would freeze.
     
  7. noboundaries-au

    noboundaries-au Member

    Joined:
    Jan 9, 2005
    Messages:
    7,571
    Location:
    Canberra, ACT
    Just a quick Q: Would u be able to name a folder that in Win x64 seeing as it has no DOS support whatsoever????
     
  8. wwwww

    wwwww Member

    Joined:
    Aug 22, 2005
    Messages:
    5,635
    Location:
    Melbourne
  9. crix75

    crix75 Member

    Joined:
    Jan 16, 2003
    Messages:
    887
    Location:
    Adelaide, SA
    Hmm, does this mean no redirection available under Win 64-bit? It does have a CLI doesn't it?
     
  10. noboundaries-au

    noboundaries-au Member

    Joined:
    Jan 9, 2005
    Messages:
    7,571
    Location:
    Canberra, ACT
    I had always assumed it had no dos support whatsoever... im not sure but, ive never used/seen it
     
  11. mrees

    mrees Member

    Joined:
    Nov 25, 2002
    Messages:
    180
    Location:
    Adelaide
    You are able to create the files, but getting rid of them is another matter all together.

    We had a user start up his new laptop and called it con, since that was his name. He then forwarded it on to us to set up. When we joined to the domain, our asset/auditing software didnt pick up the new name we gave the computer, and so created a file called con.a2k

    Then came the fun of deleting this unrequired file. Server 2k3 wouldnt let us touch it with a barge pole. Eventually we managed to get it deleted, by using a 3rd party app, but it was definatly a good leason learnt.
     
  12. blaqDeaph

    blaqDeaph Member

    Joined:
    Jul 27, 2004
    Messages:
    1,155
    Location:
    127.0.0.1
    It's supposed to have moved clean of DOS, but then again, so was Win98. You can still run 16bit DOS applications though, because XP provides backwards compactability.

    I can't seem to create a folder or file named "con" on my XP SP2 box,
     
  13. nudge

    nudge Member

    Joined:
    Sep 5, 2001
    Messages:
    860
    Location:
    Amsterdam NL
    Another annoying file naming aspect to windows is that you cannot create files and directories that start with a "." (ie .htaccess) in Explorer. However creating the file/directory at the DOS prompt is fine.
     
  14. noboundaries-au

    noboundaries-au Member

    Joined:
    Jan 9, 2005
    Messages:
    7,571
    Location:
    Canberra, ACT


    i was refering to XP 64-bit...
     
  15. wwwww

    wwwww Member

    Joined:
    Aug 22, 2005
    Messages:
    5,635
    Location:
    Melbourne
    Explorer just uses the scripting run-time (scrrun.dll), that creates files starting with . just fine, even creates filenames with just spaces, or named con.
     
  16. B1n0ry

    B1n0ry Member

    Joined:
    Jun 29, 2001
    Messages:
    380
    Location:
    Sydney, NSW
    Yes, those device names were handy back in the day.

    Lots of people knew that you could put " >nul " after a command and the output would not appear on screen. However most command output was to STDOUT. Error messages came from STDERR and there was a trick to squelching those.
    If you put in your batch file:

    ctty nul
    <insert command here>
    ctty con

    it would stop any output appearing at all. It also blocked input from the keyboard, so the command had better not expect any input :)
    I think it also blocked Ctrl+C and Ctrl+Break, which is handy for those commands you don't want anybody to cancel on you.

    CTTY seems to be an invalid command on XP now. Suppose it's not needed any more.

    Aaah, the good old batch programming days.
     
  17. petercr

    petercr Member

    Joined:
    Jan 4, 2002
    Messages:
    4,337
    Location:
    Northern Brisvegas (4504)
    Last edited: Nov 8, 2005
  18. deepspring

    deepspring Member

    Joined:
    Jul 8, 2002
    Messages:
    3,601
    Location:
    Maitland, NSW
    edit: forget it, doesn't work under XP anyway. :::(
     
    Last edited: Nov 8, 2005
  19. noboundaries-au

    noboundaries-au Member

    Joined:
    Jan 9, 2005
    Messages:
    7,571
    Location:
    Canberra, ACT
    According to microsoft's own website XP64 wont run an 16-bit programs... Can you get any thing to run in CMD... (eg. an old game), some dos programs also use a 32-bit extender... these may work????
     
    Last edited: Nov 8, 2005
  20. Pixiekicker

    Pixiekicker Member

    Joined:
    Mar 11, 2002
    Messages:
    3
    As an fyi
    CON = console input i.e. keyboard
     

Share This Page

Advertisement: