2016-03-05 45 views
1

我下载了Apache的常规-2.4.6 for Windows和从groovyConsole中执行shell命令,当我尝试执行 “目录” .execute(),我得到错误而来自groovyConsole中

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

你能告诉什么是错的?

回答

1

Windows没有“dir”作为可运行程序。这是一个built-in functioncmd

尝试

println "cmd /c dir c:\\".execute().text