Update NativeMethods.cs

This commit is contained in:
Lin Yu-Chieh (Victor) 2022-05-13 14:43:07 +08:00
parent 0af6aad781
commit 6e8dc04fbf

View File

@ -156,13 +156,12 @@ namespace Community.PowerToys.Run.Plugin.Everything
string fullPath = sb.ToString();
string name = Path.GetFileName(fullPath);
string path;
bool isFolder = Path.HasExtension(fullPath);
bool isFolder = Path.HasExtension(fullPath.Replace(".lnk", string.Empty));
if (isFolder)
path = fullPath;
else
path = Path.GetDirectoryName(fullPath);
fullPath = fullPath.Replace(".lnk", string.Empty);
string ext = Path.GetExtension(fullPath);
string ext = Path.GetExtension(fullPath.Replace(".lnk", string.Empty));
var r = new Result()
{