简体   繁体   中英

Close folders with python-Code doen't work

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM