使用antiVirusProduct.InstanceGuid卸载AV应用程序 [英] Uninstall AV application using antiVirusProduct.InstanceGuid

查看:101
本文介绍了使用antiVirusProduct.InstanceGuid卸载AV应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很喜欢这个.我有一个列出的C#应用 ManagementObjectCollection提供的所有已安装的AV应用程序 效果很好.

我们都知道已经安装了两个AV应用程序 可能会发生冲突,因此我想为用户提供卸载以下选项之一的选项: 他们.不能使用添加/删除(XP)或程序和功能(Vista) 足够友好,因此无法选择.

该属性的一个属性 ManagementObject是"instanceGuid".必须有一种使用此方法的方法

此instanceGuid与MSIEXEC Guid不相关,但必须在某处存在关系?

用于显示instanceGuid的代码如下所示: ...

I'm really banging me head with this one.  I have a C# app that lists all installed AV apps available from the ManagementObjectCollection which works great.

We all know that having two AV apps installed can clash, so I want to offer the user the option to uninstall one of them.  Using Add/Remove (XP) or Programs and Features (Vista) is not friendly enough so not an option.

One property of the ManagementObject is "instanceGuid".  There must be a way of using this GUID to uninstall the application based on the user's response?

This instanceGuid does not relate to the MSIEXEC Guid but there must be a relationship somewhere?

The code to display the instanceGuid looks something like this...

<表格样式="border-width:0px; margin:2px 0px; width:99%; border-collapse:collapse; background-color:rgb(255,255,255)" cellpadding = 0 cellspacing = 0> 公共 class SecurityCenter { 私有 ManagementObjectCollection vCollection; style ="color:blue">公共 SecurityCenter() //构造函数 {{ scope == 字符串 wql = " SELECT * FROMantiVirusProduct" ; 管理范围= ManagementScope(scope); avScope.Connect(); ="color:blue">新 ObjectQuery(wql); ManagementObjectSearcheroS = ManagementObjectSearcher(avScope,oQ); avCollection = oS.Get(); > DisplayAVGuid() {{ foreach (ManagementObject mo in avCollection) Console.WriteLine (mo [&; instanceGuid"" } }
public class SecurityCenter 
    private ManagementObjectCollection avCollection; 
 
    public SecurityCenter() // Constructor 
    { 
        string scope = "\\\\localhost\\root\\SecurityCenter"
        string wql = "SELECT * FROM antiVirusProduct"
 
        ManagementScope avScope = new ManagementScope(scope); 
        avScope.Connect(); 
 
        ObjectQuery oQ = new ObjectQuery(wql); 
        ManagementObjectSearcher oS = new ManagementObjectSearcher(avScope, oQ); 
        avCollection = oS.Get(); 
    } 
 
    public void DisplayAVGuid() 
    { 
        foreach (ManagementObject mo in avCollection) 
        { 
            Console.WriteLine(mo["instanceGuid"].ToString()); 
        } 
    } 
 
 

推荐答案

嗨!

我目前正在构建自己的安全中心,并且还在使用该解决方案.
我正在使用C#和WMI来检索AntivirusProducts和有关这些产品的信息.

现在我正在正在研究在Windows XP和Windows Vista上提供反间谍软件产品的解决方案.

我的安全中心实时监视并警告Windows防火墙是否已关闭,UAC是否已关闭等,并且还监视Windows Internet. Explorer 7 pishingfilter设置.

我目前正在研究一种解决方案,无需使用WMI即可显示反间谍软件和防病毒详细信息.

我知道您如何从PC上卸载防病毒软件.找到它的安全路径,并确保它是unistall.exe,它将启动并开始从PC解除防病毒产品或反间谍产品的安装.

您可以使用Windows Registry Unistall PATH(推荐)或WMI来执行此操作.

祝您有美好的一天...


Fisnik
Hi!

I'm currently building my own Security Center and I'm also working on with this solution.
I'm uisng C# and WMI to retrive AntivirusProducts and information about those.

Right-now I'm working on a solution to present antispyware products on Windows XP and Windows Vista.

My security center monitors real-time and warns if Windows Firewall is turned off and if UAC is turned off and etc. It also monitors Windows Internet Explorer 7 pishingfilter settings. 

I'm currently working on a solution to present antispyware and antivirus details also with-out using WMI. 

I know how you can unistall an antivirus from the PC. Find it's unistall path and make sure that it is unistall.exe which the will start and begine to unistall the antivirus product or antispyware product from the PC. 

You can use Windows Registry Unistall PATH (Recommended) or WMI to somehow do it.  

Have a nice day...

Regards,
Fisnik


这篇关于使用antiVirusProduct.InstanceGuid卸载AV应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆