Creating A Folder Named "CON"; Can It Be Done?


  1. Posts : 134
    Windows 7 Home Premium
       #1

    Creating A Folder Named "CON"; Can It Be Done?


    I have a game. Part of its functionality is to download image files that it places into folders. One of the folder created by the game is named "CON". As far as I understand it, CON is a system reserved name and can never be used. I found a workaround someone put on a webpage. But the folder created this way can only be deleted through the Windows Command Line. The folder created by my game can be deleted in Windows Explorer like normal.

    So my question is, how is this game able to create a folder named CON? More importantly, how can I do this in a way that I can delete the folder in Windows Explorer like any other folder?

    UPDATE (Read First)
    I've made a mistake. The folder has a Alt+0160 or Alt+255 character at the end of CON . Sorry guys .
    Last edited by Mulsiphix; 13 Apr 2016 at 18:11.
      My Computer


  2. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #2

    Hey Mulsiphix,

    It is still possible to create a folder with a device name. You may do this via Command Prompt's rd command by specifying a path name for the device folder while prefixing it with "\\.\" to access the Win32 device namespace.

    E.g.
    Code:
    C:\Users\Pyprohly>md \\.\C:\Users\Pyprohly\con
     
    C:\Users\Pyprohly>copy nul \\.\C:\Users\Pyprohly\con\newfile.txt
            1 file(s) copied.
     
    C:\Users\Pyprohly>dir \\.\C:\Users\Pyprohly\con /b
    newfile.txt
     
    C:\Users\Pyprohly>rd \\.\C:\Users\Pyprohly\con /s /q
    These device folders have strange behaviours and cannot be removed through Windows Explorer.
      My Computer


  3. Posts : 134
    Windows 7 Home Premium
    Thread Starter
       #3

    That is cool to know. Unfortunately, I needed to create this for a project I plan on sharing with others. So if it isn't a normal behaving folder, it would be too problematic. Thank you. I appreciate the information
      My Computer


  4. Posts : 191
    Windows 7 Home Premium bit
       #4

    Try "alt0160" before CON (hold down 'alt' while typing 0160, then C, O, N), <- invisible charactor, shows " CON" also, 'goes to the top of the list'.

    Is this what you want??

    -c-
      My Computer


  5. Posts : 134
    Windows 7 Home Premium
    Thread Starter
       #5

    Mulsiphix said:
    UPDATE (Read First)
    I've made a mistake. The folder has a Alt+0160 or Alt+255 character at the end of CON . Sorry guys .
    Unfortunately not. I need it to be alphabetized properly in a sea of other folders in the same directory. Thank you though .
      My Computer


  6. Posts : 6,285
    Windows 10 Pro X64
       #6

    Why would a game require a folder that is the same as a system device?


    Why not ask the maker of the game to fix the problem?
      My Computer


  7. Posts : 134
    Windows 7 Home Premium
    Thread Starter
       #7

    The game is a card game and it uses three letter abbreviations for different card expansions. CON is a real world code for the expansion and so it was using that. It is open source and programmed in Java. It is possible that the developer doesn't use Windows natively *shrug*. But I have contracted the developers and let them know *fingers crossed*.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:43.
Find Us