diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs index 72b7b0a91cb..b93fb23c989 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs @@ -97,8 +97,8 @@ public class ShellLink } // To initialize the app description - public String description = String.Empty; - + public string description = string.Empty; + public string arguments = string.Empty; // Retrieve the target path using Shell Link public string retrieveTargetPath(string path) @@ -122,13 +122,16 @@ public string retrieveTargetPath(string path) buffer = new StringBuilder(MAX_PATH); ((IShellLinkW)link).GetDescription(buffer, MAX_PATH); description = buffer.ToString(); + + buffer.Clear(); + ((IShellLinkW)link).GetArguments(buffer, MAX_PATH); + arguments = buffer.ToString(); } // To release unmanaged memory Marshal.ReleaseComObject(link); return target; - } } -} \ No newline at end of file +} diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index d973185b29d..7fbffb548e4 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -26,11 +26,11 @@ public class Win32 : IProgram, IEquatable public string UniqueIdentifier { get => _uid; set => _uid = value == null ? string.Empty : value.ToLowerInvariant(); } // For path comparison public string IcoPath { get; set; } /// - /// Path of the file. It's the path of .lnk or .url for .lnk and .url. + /// Path of the file. It's the path of .lnk and .url for .lnk and .url files. /// public string FullPath { get; set; } /// - /// Path of the excutable for .lnk, or the URL for .url. + /// Path of the excutable for .lnk, or the URL for .url. Arguments are included if any. /// public string LnkResolvedPath { get; set; } /// @@ -185,7 +185,7 @@ public List ContextMenus(IPublicAPI api) { var info = new ProcessStartInfo { - FileName = ExecutablePath, + FileName = FullPath, WorkingDirectory = ParentDirectory, Verb = "runas", UseShellExecute = true @@ -275,6 +275,12 @@ private static Win32 LnkProgram(string path) program.LnkResolvedPath = Path.GetFullPath(target); program.ExecutableName = Path.GetFileName(target); + var args = _helper.arguments; + if(!string.IsNullOrEmpty(args)) + { + program.LnkResolvedPath += " " + args; + } + var description = _helper.description; if (!string.IsNullOrEmpty(description)) {