Question: I want to delete Read-only Folder. I did like this

```
  //Remove Read-only for the Folder
File.SetAttributes(folderpath, File.GetAttributes(folderpath) & ~FileAttributes.ReadOnly);
//Delete Folder
      FileInfo myfileinf = new FileInfo(folderpath);
        myfileinf.Delete();

```

But i get this Error
"Access to the path 'E:\Working Folder\RPEssential\RPEssential\ResourcePlus-PL\RDLReports\t' is denied".

Answer: 
As I commented earlier the problem is that you are trying to delete a folder as you were deleting a file.

You should use Directory.Delete method to delete a folder. 

In the following link there is a good example on how to use it 

<http://msdn.microsoft.com/en-au/library/fxeahc5f(v=vs.100).aspx>

```
public static void Main() 
{
    // Specify the directories you want to manipulate.
    string path = @"c:\MyDir";
    string subPath = @"c:\MyDir\temp";

    try 
    {
        // Determine whether the directory exists.
        if (!Directory.Exists(path)) 
        {
            // Create the directory.
            Directory.CreateDirectory(path);
        }

        if (!Directory.Exists(subPath)) 
        {
            // Create the directory.
            Directory.CreateDirectory(subPath);
        }

        // This will succeed because subdirectories are being deleted.
        Console.WriteLine("I am about to attempt to delete {0}", path);
        Directory.Delete(path, true);
        Console.WriteLine("The Delete operation was successful.");

    } 
    catch (Exception e) 
    {
        Console.WriteLine("The process failed: {0}", e.ToString());
    } 
    finally {}
}

```
There can be many reasons for a read only to be denied. Is the folder in use? Open in a console? Running an executable? All of these things you should check. Even if it has the permission, if the directory is in use, it won't allow you to delete it.