Call Ruby from a VBScript

前端 未结 1 755
闹比i
闹比i 2020-12-22 07:28

Hey I have been working with ruby and vbscript lately. There is a scenario where I need to call a ruby script from another vbscript an

相关标签:
1条回答
  • 2020-12-22 08:15

    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)
    

    to

    nRet = newobj.Run("%comspec% /c ruby E:\rubyfile.rb > D:\newdoc.txt",1,true)
    

    (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")

    0 讨论(0)
提交回复
热议问题