Part of my python program uses subprocess to open a vbs script.
path = os.sep.join(['C:','Users',getpass.getuser(),'Desktop','Program','build','exe.win32-3.6','vbs.vbs'])
subprocess.call([sys.executable, path])
But instead of executing my vbs script it tries to run it as a python code and gives me: NameError: msgbox is not defined. And when i manually run vbs script it works.
I want python to normally execute the vbs script. Not run it as python code.
sys.executableis the Python interpreter. Use the name of the executable you want to run the.vbsfile with instead.