3

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 2

5

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

 system "cscript //nologo script.vbs #{random_filename}"
Sign up to request clarification or add additional context in comments.

Comments

0

Use system and pass it as a command-line arg

system "script.vbs #{random_filename}"

3 Comments

Thanks...I tried it but does not work. Any idea why it would not work?
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"
As stated below you need to probably pass it to the Windows Scripting Host. so add cscript to the above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.