<div>When I run the following code:</div>
<div> </div>
<div>import os</div>
<div> </div>
<div>file = "C:\\progra~1\\mozill~1\\firefox.exe <a href="http://www.google.com">www.google.com</a>"</div>
<div>os.system(file)                                                                  # this will spawn Firefox and naviage to <a href="http://google.com">google.com</a></div>
<div> </div>
<div>kill = "taskkill /f /im firefox.exe"</div>
<div>os.system(kill)                                                                  # this should kill Firefox instance that was just spawned</div>
<div> </div>
<div> </div>
<div> </div>
<div>the script never gets to kill the insance of firefox. When I manually close Firefox, my cmd window indicates that the taskkill command was unsuccessful, which leads me to believe that after I open Firefox the system is not getting any indication that the command finished executing, which would result in Firefox not being killed. I also tried substituting "
os.system" with "os.popen" which did the same thing.</div>
<div> </div>
<div>Anyone have an idea how I can kill the instance of Firefox?</div>
<div> </div>