none
System.IO.DirectoryInfo Class "Attributes" property showing invalid enum value 65552. RRS feed

  • Question

  • I have an application folder created inside Program Data, i.e path C:/ProgramData/AppName.

    I am able to access files located at this path from code. Physically Folder exists, but when going to that path from File Explorer it does not show that folder.

    I tried following steps to get to that folder, but couldn't get any success.

    1. Checking and getting path from code, files and folders at that path exists.

    2. "Windows Key + R"  Run -> C:/ProgramData/AppName it shows error "C:/ProgramData/AppName is unavailable. If the location is on this PC, make sure the device or drive is connected or the disc is inserted, and then try again. If the location is on a network, make sure you're connected to the network or Internet, and then try again. If the location still can't be found, it might have been moved or deleted."

    3. Go to task manager -> File -> Run New Task -> Write "C:/ProgramData/AppName" -> Check Mark "Create this task with administrative privileges." -> Go to ProgramData folder, AppName folder cannot be found.

    4. Go to Command Prompt, execute command "cd C:/ProgramData/AppName" it shows error ""The system cannot find the path specified."

    5. Checking Directory information from code, 

    if (Directory.Exists("C:/ProgramData/AppName"))
    {
       var th = new DirectoryInfo(path);
       var attribute = th.Attributes;
    }

    th.Attributes shows "65552" value, while checking for other folders inside ProgramData it shows th.Attributes value System.IO.FileAttributes.Directory.


    How do I go to this path phsically from File Explorer? 

    Previously I was able to go that path From File Explorer, Now I dont know what went wrong I am unable to go to that path.



    Friday, October 11, 2019 6:53 AM

All replies

  • According to Windows API documentation, the attribute is reserved for system use and denotes a virtual directory. Therefore, it is not a regular one.

    How was “AppName” subfolder created?

    By the way, usually “\” is used instead of “/”.

    Friday, October 11, 2019 5:00 PM
  • As you stated it denotes a virtual directory meaning its "Attribute Value = 65552". If it does so, how do I remove it from the virtual directory and make it as visual one.

    Thanks.

    Monday, October 14, 2019 4:57 AM
  • As you stated it denotes a virtual directory meaning its "Attribute Value = 65552". If it does so, how do I remove it from the virtual directory and make it as visual one.

    Thanks.

    Hi,

    show hidden files/folders

    View-Options-change folder and search options-view

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 14, 2019 5:48 AM
    Moderator
  • Hello Alex,

    I tried this solution it didn't work. How do I resolve it ?

    Thanks.

    Monday, October 14, 2019 5:56 AM
  • Hi,

    If you recreate the folder(in a different location), will the "Attributes" property value also show 65552?

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 15, 2019 6:27 AM
    Moderator