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.
2 Answers
Use system and pass it as a command-line arg
system "script.vbs #{random_filename}"
3 Comments
andHapp
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"
mletterle
As stated below you need to probably pass it to the Windows Scripting Host. so add cscript to the above.