Search code examples
c++windowsregistry

WMIC to unistall a program in Wow6432Node


Hello want to use wmic to unistall a program the problem is that the program is stored in:

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

And wmic can only view by default:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall

Can you find a way to unistall apps in:

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

using wmic?

I have seen some posts regarding this problem:

Also found this might be helpfull:

I really need to use wmic for uninstall the program can anyone help me? Can anyone create a small function in cpp to set WMIC on HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall as default?

I know it is hard, any help would be great!!!


Solution

  • Doing what you are asking for is documented under Requesting WMI Data on a 64-bit Platform:

    C++ applications can use the IWbemContext interface with IWbemServices::ExecMethod to communicate the use of a nondefault provider to WMI.