0

I've written a small Python script to test my Visual Basic scripts function correctly before deploying them -

import subprocess
subprocess.call("cmd /c MyScript.vbs")

Rather than running the Visual Basic script, my script opens in Sublime Text (the default program).

How can I run the scripts rather than Opening them?

1 Answer 1

2

Use one of these, cscript is more appropriate for a console application.

subprocess.call("cmd /c wscript MyScript.vbs")

or

subprocess.call("cmd /c cscript MyScript.vbs")

An excellent answer as to what the difference is can be found here: Difference between wscript and cscript

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. What is the difference between the two?
one is more appropriate for a "windowed" app, the other for console. i amended the answer with a link to a thorough explanation

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.