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?

alroc
  • 27,574
  • 6
  • 51
  • 97
Eilidh
  • 1,270
  • 1
  • 13
  • 33

1 Answers1

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

Community
  • 1
  • 1
Raf
  • 9,681
  • 1
  • 29
  • 41
  • Thank you. What is the difference between the two? – Eilidh Apr 30 '14 at 10:19
  • 1
    one is more appropriate for a "windowed" app, the other for console. i amended the answer with a link to a thorough explanation – Raf Apr 30 '14 at 10:24