title: Access Denied on accessing the system folder of any drive like system volume information
body: <p>I have the following recursion code to get all the folders and files of a selected directory. But when I select a drive, for example <code>E:\\ ..</code>, I am getting an error message of </p>
  
  <p><code>"Access denied in accessing E:\system volume information"</code></p>
  
  <p>Is it possible to bypass the system volume information folder?</p>
  
  <p>This is the code I am using:        </p>
  
  <pre><code>private static ArrayList GenerateFileList(string Dir)
  {
      ArrayList fils = new ArrayList();
      bool Empty = true;
  
      foreach (string file in Directory.GetFiles(Dir)) // add each file in directory
      {
          fils.Add(file);
          Empty = false;
      }
  
      if (Empty)
      {
          if (Directory.GetDirectories(Dir).Length == 0)
              // if directory is completely empty, add it
          {
              fils.Add(Dir + @"/");
          }
      }
  
      foreach (string dirs in Directory.GetDirectories(Dir)) // recursive
      {
          foreach (object obj in GenerateFileList(dirs))
          {
              fils.Add(obj);
          }
  
      }
          return fils; // return file list
       }
  </code></pre>