更新时间:2023-12-05 14:00:28
你需要一个 shell (%comspec%/c
) 来获得一个 shell 的功能,比如 >
重定向.所以改变
You need a shell (%comspec% /c
) to get a shell's feature like >
redirection. So change
obj = newobj.Run("ruby E:\rubyfile.rb > D:\newdoc.txt",1,true)
到
nRet = newobj.Run("%comspec% /c ruby E:\rubyfile.rb > D:\newdoc.txt",1,true)
(研究 .Run 文档 查看使用 nRet
而不是 obj
的原因,并思考newobj"这个名字的糟糕之处)
(Study the docs for .Run to see the reason for nRet
instead of obj
and spend a thought on the lousy-ness of the name "newobj")