2

I have to constantly switch back and forth between two installations of a web app with two different versions of an ActiveX control. Therefore I'd like to script the ability to uninstall this control. Its does not show up in Win32_Product because it was not installed via windows installer, and contrary to this answer, the Win32_ClassicCOMClass does not contain this ActiveX control.

AXHelper shows the control in HKEY_CLASSES_ROOT\CLSID. So my two questions are:

  • How do I enumerate the control with WMI
  • How do I uninstall the control with WMI
Justin Dearing
  • 1,017
  • 10
  • 33

1 Answers1

2

You can usually find the activex ocx file in C:\windows\Downloaded Program Files.

To uninstall use cmd in powershell as cmd /c 'regsvr32 /u "C:\windows\Downloaded Program Files\youractivex.ocx"

Use $lastexitcode to verify success

Once it's uninstalled remove the ocx file from the downloaded program files folder and copy in the ocx file for the different version then install just as the uninstall command but without the /u

James Santiago
  • 876
  • 5
  • 11