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

1 Answer 1

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

2
  • James, the program is not stored there, but I know where it is. I will try this later today. Jul 20, 2011 at 13:05
  • That uninstalls the OCX, but does not remove it from the Programs and Features (Add Remove Programs on XP and previous). Jul 25, 2011 at 12:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .