Skip to content

Commit 8825e63

Browse files
authored
Fix: Fixed issue with environment variables not working for shortcuts (#11130)
1 parent ce26b20 commit 8825e63

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Files.App/Helpers/UIFilesystemHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public static async Task CreateShortcutFromDialogAsync(IShellPage associatedInst
414414
/// <param name="runAsAdmin"></param>
415415
public static void UpdateShortcutItemProperties(ShortcutItem item, string targetPath, string arguments, string workingDir, bool runAsAdmin)
416416
{
417-
item.TargetPath = targetPath;
417+
item.TargetPath = Environment.ExpandEnvironmentVariables(targetPath);
418418
item.Arguments = arguments;
419419
item.WorkingDirectory = workingDir;
420420
item.RunAsAdmin = runAsAdmin;

src/Files.App/ViewModels/Properties/FolderProperties.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public override void GetBaseProperties()
6161
ViewModel.ShortcutItemOpenLinkCommand = new RelayCommand(async () =>
6262
{
6363
await App.Window.DispatcherQueue.EnqueueAsync(
64-
() => NavigationHelpers.OpenPathInNewTab(Path.GetDirectoryName(ViewModel.ShortcutItemPath)));
64+
() => NavigationHelpers.OpenPathInNewTab(Path.GetDirectoryName(Environment.ExpandEnvironmentVariables(ViewModel.ShortcutItemPath))));
6565
}, () =>
6666
{
6767
return !string.IsNullOrWhiteSpace(ViewModel.ShortcutItemPath);

0 commit comments

Comments
 (0)