os_can_exe() used by executable() actually checks PATHEXT. Behaviour in Vim is:
executable('no_such_file') returns 0
executable('file') returns 1 if file.bat,file.exe,etc exist ($PATHEXT)
executable('file.bat')returns 1
executable('file.exe')returns 1
This could lead to the misconception that, for example, executable("file.bat") being 1 implies that system(["file.bat"]) is expected to succeed, which is not true. But this is an issue with system([])
in windows and not with executable()
. The notion of executable in Windows is fundamentaly a shell concept, because unlike UNIX there no notion of shebang and permission bits, that allows execution of non binary files.