[英]How to control Windows' Programs and Features using Python
I can think of 3 ways to do this.我可以想到 3 种方法来做到这一点。
A) Read the uninstall entries yourself from the registry. A)自己从注册表中读取卸载条目。 There are 4 locations, HKCU/HKLM, 32&64-bit.
有 4 个位置,HKCU/HKLM,32 位和 64 位。
Software\Microsoft\Windows\CurrentVersion\Uninstall
and enumerate the subkeys. Software\Microsoft\Windows\CurrentVersion\Uninstall
并枚举子项。
B) Using the shell interfaces. B)使用 shell 接口。 When you have the
IShellFolder
for the Programs and Features you can get the IContextMenu
and execute command.当您拥有程序和功能的
IShellFolder
时,您可以获得IContextMenu
并执行命令。 I don't recommend this because Programs and Features is going away, everything is being moved to the Settings app.我不建议这样做,因为程序和功能正在消失,所有内容都被移至“设置”应用程序。
C) UIAutomation . C) UI自动化。 Not recommended for the same reason as B and it can also be fragile.
不推荐使用与 B 相同的原因,它也可能很脆弱。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.