Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top