diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl
index b5a2e5a4a6805167f3949c7fe19e8ebef1191905..bc44c440c3244bec89d668b0725d2abfba25ca93 100644
--- a/mysql-test/lib/mtr_misc.pl
+++ b/mysql-test/lib/mtr_misc.pl
@@ -108,7 +108,14 @@ sub mtr_exe_exists (@) {
   map {$_.= ".exe"} @path if $::glob_win32;
   foreach my $path ( @path )
   {
-    return $path if -x $path;
+    if($::glob_win32)
+    {
+      return $path if -f $path;
+    }
+    else
+    {
+      return $path if -x $path;
+    }
   }
   if ( @path == 1 )
   {