Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6172435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:23:31+00:00 2026-05-23T23:23:31+00:00

I am having an issue that is really killing me. I have a directory

  • 0

I am having an issue that is really killing me.

I have a directory that when I go to the properties window, shows Read-Only as partially checked (not a full check box, but the box is filled).

So I looked in the directory and I checked all the files, none of them have the read-only attribute. Only the folder has it, and only partially.

I tried the following code:

if (directoryInfo.Exists)
{
    try
    {
        directoryInfo.Attributes &= ~FileAttributes.ReadOnly;

        foreach (FileInfo f in directoryInfo.GetFiles())
        {
           f.IsReadOnly = false;
        }
    }
    catch (Exception e)
    {
        throw e;
    }
}

It still did not work. I can right click on the folder and manually remove the read-only permissions but I need to be able to do this in code. The code executes but does not error.

Anyone have any idea what the issue could be? My only guess is because the folder is on a network share (in the form of \\computer\folder\subfolder), that I might need special rights in order to change permissions on a folder?

Please someone help.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:23:32+00:00Added an answer on May 23, 2026 at 11:23 pm

    readonly on folders is used by Windows internally… if you really need to change it then is some work involved (Registry and changing alot of folders)… see http://support.microsoft.com/kb/256614/en-us

    Why do you need to make that change ?

    EDIT – some information on Powershell and TFS:

    http://codesmartnothard.com/ExecutingPowerShellScriptsOnRemoteMachinesWithTFS2010AndTeamDeploy2010.aspx

    http://blogs.msdn.com/b/yao/archive/2011/06/15/tfs-integration-pack-and-scripting-using-powershell.aspx

    or try a normal “batch file” (.bat) with “attrib -r” on the folder

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having an issue here that I have tried everything I can think of but
I am having an issue with somethign that I thoguth woudl have been simple.
We are having the issue that the app we have has an In-App purchase
I'm having a problem that I really can't comprehend… I'm not sure if backbone
I am having an issue that is stumping me. I have a relatively simple
After being troubled by an issue that I simply did not have the knowledge
I having issue that content assistant / intellisense is working in methods such as
I am having an issue that I can't seem to figure out. Hopefully somebody
so I am having this issue that has been driving me crazy for hours,
I'm having an issue that I think is simple to diagnose, but I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.