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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -