Im trying to write and execute a .vbs file with python. When I run the program, the IDE shows an error that the file I tried to make isn't there, so therefore it couldn't be executed. I followed exactly the documentation in python.org and other similar questions in stack overflow but they didn't give a good answer to my problem. Here is the code I tried to run:
import os
a = open('draw.vbs','w+')
a.write('do\nSet oWMP = CreateObject(\"WMPlayer.OCX.7\")\nSet colCDROMs oWMP.cdromCollection\nif colCDROMs.count >= 1\ncolCDROMs.Item(i).eject\nNext cdrom\nEnd If\nloop')
b = os.system('draw.vbs')