Domanda

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?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top