diff --git a/src/main/java/hudson/plugins/groovy/Groovy.java b/src/main/java/hudson/plugins/groovy/Groovy.java
index <HASH>..<HASH> 100644
--- a/src/main/java/hudson/plugins/groovy/Groovy.java
+++ b/src/main/java/hudson/plugins/groovy/Groovy.java
@@ -222,11 +222,16 @@ public class Groovy extends AbstractGroovy {
         }
 
         private File getExeFile(String execName) {
-            if (File.separatorChar == '\\') {
-                execName += ".exe";
-            }
             String groovyHome = Util.replaceMacro(getHome(),EnvVars.masterEnvVars);
-            return new File(groovyHome, "bin/" + execName);
+            File binDir = new File(groovyHome, "bin/");
+            if (File.separatorChar == '\\') {                
+                if(new File(binDir, execName + ".exe").exists()) {
+                    execName += ".exe";
+                } else {
+                    execName += ".bat";
+                }
+            }
+            return new File(binDir, execName);            
         }
 
         /**
Support for *.bat executable on windows, applied patch from HUDSON-<I>