0
import os
var = 'x=msgbox("File could not be found." & vbNewLine & "Remove windows?", 0+16, "DAM")'
f=open("error.vbs", "w")
f.write(var)
f.close()
os.system('error.vbs')

I have this code, but it doesn't run error.vbs after I create it. How might I fix this?

Ted6794
  • 7
  • 3
  • Is your `error.vbs` script executable? What does `os.stat('error.vbs')` return? [This answer](http://stackoverflow.com/questions/12791997/how-do-you-do-a-simple-chmod-x-from-within-python) might help. – Matt Oct 10 '16 at 19:44
  • `error.vbs` does not seem to be executable. – Luca Oct 10 '16 at 19:44
  • How would I fix this? I've tried os.start('error.vbs') – Ted6794 Oct 10 '16 at 20:11
  • Related question: [Executing a vbs file with arguments created by python](http://stackoverflow.com/questions/19112944/executing-a-vbs-file-with-arguments-created-by-python) – cyroxx Oct 10 '16 at 21:27

0 Answers0