PathIsExe

[DllImport("shlwapi.dll", CharSet = CharSet.Unicode)]
public static extern bool PathIsExe(
   string pszFile
);

Microsoft documentation: Link

Last updated