I have a folder name that looks like this:

```
\\server\pictures\607\27022015\HARD\  //temp dir
\\server\pictures\607\27022015\HARD\550528  //dir name (two spaces behind)
macId //a string representative of a folder name (two spaces behind)

```

In my code I get the folder name by doing this:

```
if (Directory.Exists(tempDirectoryWithoutMac))
                {
                    var subDirectories = Directory.GetDirectories(tempDirectoryWithoutMac);

                    var directoryToSearch = subDirectories.Where(c => c.Contains(macId.Trim()));

                    if (directoryToSearch.Any())
                    {
                        var newDirectory = directoryToSearch.First();

                        foreach (string filename in Directory.GetFiles(newDirectory))
                        {
                            var retVal = new BitmapImage(new Uri(filename.TrimEnd()));

                            return retVal;
                        }
                    }
                }

```

If I inspect and then copy and paste the `newDirectory` into Windows Explorer it takes me to the folder; however, my code throws an exception:

```
The network path was not found.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.Directory.GetFiles(String path)
   at URM.ViewModels.CollectionsViewModel.GetImages(String macId, String type)

```

If I try to rename the folder taking out the spaces at the end...Windows says...the source and destination file names are the same.

**Edit**
I'm pasting this path (quotes used to show spaces):

"\\server\pictures\607\27022015\HARD\550528  "