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
2009-02-22 01:10:34
Thanks...I tried it but does not work. Any idea why it would not work?
andHapp
2009-02-22 01:24:49
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
2009-02-22 01:28:29
As stated below you need to probably pass it to the Windows Scripting Host. so add cscript to the above.
mletterle
2009-02-22 01:53:46
+4
A:
Try calling the Windows Scripting Host (cscript
) with your script:
system "cscript //nologo script.vbs #{random_filename}"
Patrick Cuff
2009-02-22 01:50:46