Call Ruby from a VBScript -
hey have been working ruby
, vbscript
lately. there scenario need call ruby script vbscript
, stuck there. tried code,
set newobj = createobject("wscript.shell") obj = newobj.run("ruby e:\rubyfile.rb > d:\newdoc.txt",1,true)
but ruby script not giving result. doing right or there other way it? if ruby script executed separately results generated, problem not ruby script.
you need shell (%comspec% /c
) shell's feature >
redirection. 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 docs .run see reason nret
instead of obj
, spend thought on lousy-ness of name "newobj")
Comments
Post a Comment