I have a directory path of C:\\Subdir1\\Subdir2\\Subdir3\\filename.xml.
C:\\Subdir1\\Subdir2\\Subdir3\\filename.xml
I need to first check if the file, filename.xml exists in the root
filename.xml
Directory.GetParent(dir).FullName
Try this one Directory.GetParent and System.IO.File.Exists
Directory.GetParent
System.IO.File.Exists