diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Path/FolderHelper.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Path/FolderHelper.cs index 6e18018bb8..847e80587a 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Path/FolderHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Path/FolderHelper.cs @@ -84,11 +84,17 @@ namespace Microsoft.Plugin.Folder.Sources throw new ArgumentNullException(nameof(search)); } - // Absolute path of system drive: \Windows\System32 if (search[0] == '\\' && (search.Length == 1 || search[1] != '\\')) { + // Absolute path of system drive: \Windows\System32 search = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), search.Substring(1)); } + else if (search[0] == '~') + { + // User home + var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + search = search.Length > 1 ? Path.Combine(home, search.Substring(2)) : home; + } return Environment.ExpandEnvironmentVariables(search); }