0

I work with python 2.7.8 and i use this code to close all open applications:

import os,subprocess

os.system('taskkill /im chrome.exe')
os.system('taskkill /im POWERPNT.exe')
os.system('taskkill /im OUTLOOK.exe')
os.system('taskkill /im WINWORD.exe')
os.system('taskkill /im ArcMap.exe')
os.system('taskkill /im acadlt.exe')
os.system('taskkill /im EXCEL.exe')
os.system('taskkill /im AcroBat.exe')
os.system('taskkill /im wmplayer.exe')
subprocess.call('nircmd.exe win close class "CabinetWClass"' , shell=True)

I succeed to close all applications except OUTLOOK and all the open folder of the windows 7 Professional

user4989939
  • 349
  • 1
  • 3
  • 14

1 Answers1

-1

Try restart explorer.exe to close open folders.

os.system('taskkill /im explorer.exe')
os.system('explorer.exe')

Try f (force) parameter to force Outlook to close.

os.system('taskkill /f /im OUTLOOK.exe')

Also you can try this; https://stackoverflow.com/a/4230226/4471283

Community
  • 1
  • 1
Umut Çağdaş Coşkun
  • 1,197
  • 2
  • 15
  • 33