Skip to content

Commit 953837a

Browse files
authored
Fix: Fixed invalid "Network folder error" when opening shell folders (#11886)
1 parent 7b76c45 commit 953837a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Files.App/Filesystem/Drives.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ public static async Task<StorageFolderWithPath> GetRootFromPathAsync(string devi
9191
return new StorageFolderWithPath(matchingDrive, rootPath);
9292
}
9393
}
94-
else if (devicePath.StartsWith(@"\\", StringComparison.Ordinal)) // Network share
94+
// Network share
95+
else if (devicePath.StartsWith(@"\\", StringComparison.Ordinal) &&
96+
!devicePath.StartsWith(@"\\SHELL\", StringComparison.Ordinal))
9597
{
9698
int lastSepIndex = rootPath.LastIndexOf(@"\", StringComparison.Ordinal);
9799
rootPath = lastSepIndex > 1 ? rootPath.Substring(0, lastSepIndex) : rootPath; // Remove share name

src/Files.App/ViewModels/ItemViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,7 @@ public async Task<int> EnumerateItemsFromStandardFolderAsync(string path, Cancel
14781478
bool isWslDistro = App.WSLDistroManager.TryGetDistro(path, out _);
14791479
bool isNetwork = path.StartsWith(@"\\", StringComparison.Ordinal) &&
14801480
!path.StartsWith(@"\\?\", StringComparison.Ordinal) &&
1481+
!path.StartsWith(@"\\SHELL\", StringComparison.Ordinal) &&
14811482
!isWslDistro;
14821483
bool enumFromStorageFolder = isBoxFolder;
14831484

0 commit comments

Comments
 (0)