简体   繁体   English

使用python代码关闭文件夹不起作用

[英]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: 我使用python 2.7.8,并使用以下代码关闭所有打开的应用程序:

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 我成功关闭了除OUTLOOK和Windows 7 Professional的所有打开文件夹以外的所有应用程序

Try restart explorer.exe to close open folders. 尝试重新启动explorer.exe以关闭打开的文件夹。

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

Try f (force) parameter to force Outlook to close. 尝试使用f (强制)参数强制Outlook关闭。

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

Also you can try this; 您也可以尝试一下; https://stackoverflow.com/a/4230226/4471283 https://stackoverflow.com/a/4230226/44712​​83

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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