-3

I want to uninstall any application in my system using python

I tried using wmic command but it only shows few applications in your system not all of them . I am trying but not getting solution for this problem . Any advice would be helpful

Inofearu
  • 58
  • 5
  • You need to at least tag this Windows -- it's a _very_ operating-system-specific question. – Charles Duffy Jul 07 '23 at 12:52
  • 1
    The bigger problem, though, is that this isn't a solved or solvable problem because software installation on Windows is a huge mess. People have for decades now made money selling Windows software _with the sole purpose_ of comprehensively uninstalling other software; it's only something you can make money off of because OS-provided facilities can't reliably do it itself. – Charles Duffy Jul 07 '23 at 12:53
  • (Yes, software _sometimes_ registers an uninstaller; whether those uninstallers actually work, or are comprehensive in how effectively they remove the relevant item, is _very_ spotty; when you ask how to uninstall _any_ application, you're making the question too broad to be amenable to any comprehensive answer -- someone would basically need to work out all the algorithms in those commercial apps, _and the ones they're missing_, to build a comprehensive solution). – Charles Duffy Jul 07 '23 at 12:55
  • @CharlesDuffy - no *other* OSes have managed to master uninstall, either...the closest is macOS/OSX (presuming you're running a .app application; .pkg apps are an RPITA to remove from Macs) – warren Aug 18 '23 at 18:27
  • @warren, I wholeheartedly disagree; NixOS has it _comprehensively_ licked. See https://edolstra.github.io/pubs/phd-thesis.pdf -- jump to the "overview" section if you're in a hurry. The big point here is that NixOS doesn't do the "jumble everything together into one big filesystem" approach in the first place; everything gets its own hash-addressed location, and references to dependencies are themselves only through hashes. That means you can have N versions of the same thing installed at the same time; they'll all have different hashes so they never conflict. – Charles Duffy Aug 18 '23 at 21:14
  • 1
    @warren, ...at that point, "uninstallation" is just reference-counted garbage collection. (BTW, you can also -- and I, personally, _do_ -- run [Nix](https://nixos.org/) on MacOS; far better designed than Macports or Homebrew or any of the other contemporaries). – Charles Duffy Aug 18 '23 at 21:17
  • 1
    @CharlesDuffy - should have said, "no other *mainstream* OSes" ... Plan9 solved it, too ... but, sadly, never took off :) ...the way Nix handles dependency mapping reminds me a *lot* of Plan9's structure (though, of course, ~30y newer). Given its generally-higher storage usage, it will be interesting to see if it takes off (macOS/OS X/NextSTEP's .app format uses more space because each .app bundle includes its own dependencies, but does not *seem* to have affected adoption much (multiple, independent editions of the same app on your machine at once is one of .app's biggest selling points)) – warren Aug 21 '23 at 13:26

1 Answers1

1

This is because wmic only shows those installed via .MSI installers.

wmic only checks HKEY_CLASSES_ROOT\Installer\Products.

Other installers have different locations such as:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

You'd need to search more than the wmic location for the program you want and grab the SilentUninstallString or UninstallString values to execute from the relevant registry location.

Inofearu
  • 58
  • 5