you could use try/catch around the Directory.GetDirectories call. It looks like you are trying to get the windows folder which can be done in a much neater way like this:
string windowsFolder = Environment.GetFolderPath(Environment.SpecialFolder.Windows);