var fn = openFileDialogSapTable.FileName; var currentPath = Path.GetFullPath( fn ); currentPath = Directory.GetParent(currentPath).FullName;