Search code examples
windowswinapiexecutableshellexecute

How to tell if a path points to an application in Windows


If I have a file path (that might be later passed to the ShellExecute API) is there any way to tell if it points to an application?

I need this to work under Windows from a C++ program. Also, this path may contain start-up command line parameters.


Solution

  • You can use the SaferiIsExecutableFileType function in order to check if the file is executable.