Uninstall through WMI

D

Dan Pavel

Hi,

I need to build an small application to uninstall an application,
remotely, from the computers in my network. How I can do this through
WMI. It is not an application installed by MSI.
I use this to gather the UninstallString:

keyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" +
subKey;
keyName = "DisplayName";
keyString = "UninstallString";
ManagementBaseObject outParam =
wmiRegistry.InvokeMethod("GetStringValue", inParam, null);
if ((uint)outParam["ReturnValue"] == 0)
{
listBox1.Items.Add(Convert.ToString(outParam["sValue"]));
}

but after I have this uninstall string, I don't know how to use it to
start the uninstallation.
Please help
Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top