Skip to content

Commit

Permalink
Fix: Fixed environment variables expansion for shortcuts (#14425)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qin-shihuang committed Jan 12, 2024
1 parent c19f829 commit 9eafcf6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Files.App/Utils/Shell/ShellFolderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using System;
using System.IO;
using Vanara.PInvoke;
using Vanara.Windows.Shell;
Expand Down Expand Up @@ -127,8 +128,8 @@ public static ShellLinkItem GetShellLinkItem(ShellLink linkItem)
IsFolder = !string.IsNullOrEmpty(linkItem.TargetPath) && linkItem.Target.IsFolder,
RunAsAdmin = linkItem.RunAsAdministrator,
Arguments = linkItem.Arguments,
WorkingDirectory = linkItem.WorkingDirectory,
TargetPath = linkItem.TargetPath
WorkingDirectory = Environment.ExpandEnvironmentVariables(linkItem.WorkingDirectory),
TargetPath = Environment.ExpandEnvironmentVariables(linkItem.TargetPath)
};

return link;
Expand Down

0 comments on commit 9eafcf6

Please sign in to comment.