Q:

How to delete all files in sub directories in 1 hit permanently

I have a directory struture like so:
c:\year\month\day\hour\min
The 'year' root and downwards can all have many sub-directories
Starting from the 'Day' sub-root I wish to delete all files and directories within the sub-child-directories.
When I say delete permanently I mean not sending to the Recycle Bin.
I found his code that will do that:
using Microsoft.VisualBasic.FileIO:

var files = GetAllFiles(suggested);
foreach (var file in files)
{     
    FileSystem.DeleteFile(file, UIOption.OnlyErrorDialogs,RecycleOption.DeletePermanently, UICancelOption.ThrowException);`                                      
}

 FileSystem.DeleteDirectory(suggested, UIOption.OnlyErrorDialogs,RecycleOption.DeletePermanently, UICancelOption.ThrowException);

   private static IEnumerable<string> GetAllFiles(string rootDirectory)
    {
        foreach (var file in Directory.GetFiles(rootDirectory, "*", SearchOption.AllDirectories))
        {
            yield return file;
        }
    }

What I would love to do is omit the GetFilesMethod(path) and do something like this:
FileSystem.DeleteDirectory(suggested, UIOption.OnlyErrorDialogs,RecycleOption.DeletePermanently, UICancelOption.ThrowException, recursive=true, all contents);

Obviously, 'recursive=true, all contents' is SUDO code.
Thanks

A:

First, I suggest you do some benchmarks before you accuse LINQ of being slow.
Second, you can achieve what you need (permanent deletion of files with recursion) using the System.IO.Directory.Delete method:

Deletes the specified directory and, if indicated, any subdirectories and files in the directory.

Use it like this:
Directory.Delete(suggested, true);

