Python disabling startmenu and taskbar

本秂侑毒 提交于 2021-02-10 19:38:48

问题


I have a python tkinter app. Whenever my app is running, i want my window startmenu, desktop icons and task bar to be disappeared.

I actually managed to get the required result by manually going into the windows task manager and killing the process 'explorer.exe'.

But when i tried to write a python script to do that automatically like this:

import os
os.system("taskkill /im explorer.exe")

It is actually bringing up the shutting down window instead of hiding the startmenu and taskbar.

Is there any way i can lock down(or even hide) the startmenu and taskbar with the python script?

EDIT: The script will be used on

windows XP pro 32bit

python 2.7.5


回答1:


Try to pass /f as a parameter there, it should work:

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

Edit: Yap, it worked. Tested it myself..

Reference: http://technet.microsoft.com/en-us/library/bb491009.aspx

Hope this helps!



来源:https://stackoverflow.com/questions/17694159/python-disabling-startmenu-and-taskbar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!