mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 03:07:56 +01:00
PT Run tile as user home (#9579)
This commit is contained in:
committed by
GitHub
parent
6793f74b3b
commit
d2902440d2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user