tags:

views:

337

answers:

2

Is it possible to call a vbscript from a ruby script? Bascially, I am creating a temp folder with a random name in my ruby script and I would like to call the vbscript and pass the name of this folder to carry out the next action.

A: 

Use system and pass it as a command-line arg

system "script.vbs #{random_filename}"
mletterle
Thanks...I tried it but does not work. Any idea why it would not work?
andHapp
These two commands work but the call to vbscript does not work . I even tried using a vbscript name that does not exist hoping it would throw and error but it seems the calls to vbs are ignored.system "echo Hello"system "dir"
andHapp
As stated below you need to probably pass it to the Windows Scripting Host. so add cscript to the above.
mletterle
+4  A: 

Try calling the Windows Scripting Host (cscript) with your script:

 system "cscript //nologo script.vbs #{random_filename}"
Patrick Cuff