Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试执行“dir”.execute() 时,我为 windows 和 GroovyConsole 下载了 apache-groovy-2.4.6,我得到了
java.io.IOException: Cannot run program "dir": CreateProcess error=2, The system cannot find the file specified
你能说出什么是错的吗?
Windows 没有“dir”作为可运行程序。它是 中的内置函数。cmd
cmd
尝试
println "cmd /c dir c:\\".execute().text