1

I downloaded apache-groovy-2.4.6 for windows and from the GroovyConsole when i try to execute "dir".execute(), I am getting

java.io.IOException: Cannot run program "dir": CreateProcess error=2, The system cannot find the file specified

Can you tell what is wrong?

java_geek
  • 17,585
  • 30
  • 91
  • 113

1 Answers1

1

Windows does not have "dir" as a runnable program. It is a built-in function in cmd.

Try

println  "cmd /c dir   c:\\".execute().text
Jayan
  • 18,003
  • 15
  • 89
  • 143