我已經使用WMI來檢測操作系統上是否存在防病毒軟件, itz woking fine and display me information使用命名空間:\ root \ SecurityCenter和\ root \ SecurityCenter,\ root \ Security來獲取win xp和window7上的防病毒名稱和實例ID。如何使用WMI或其他WMI在C++中檢測安裝在Windows 2003 Server和2008 server 2003服務器R2和2008服務器R2上的防病毒
if(isHLOSVersion())
hres = pLoc->ConnectServer(_bstr_t(L"root\\SecurityCenter2"),
// Object path of SecurityCenter
NULL, // User name. NULL = current user
NULL, // User password. NULL = current
0, // Locale. NULL indicates current
NULL, // Security flags.
0, // Authority (e.g. Kerberos)
0, // Context object
&pSvc // pointer to IWbemServices proxy
);
else
hres = pLoc->ConnectServer(_bstr_t(L"root\\SecurityCenter"),
// Object path of SecurityCenter
NULL, // User name. NULL = current user
NULL, // User password. NULL = current
0, // Locale. NULL indicates current
NULL, // Security flags.
0, // Authority (e.g. Kerberos)
0, // Context object
&pSvc // pointer to IWbemServices proxy
);
但在Windows的情況下,2003服務器和2008服務器2003服務器中R 2 2008服務器R2以上這些命名空間中不存在那麼這是不是在那裏工作。
請讓我知道我們如何檢測到防病毒存在或不存在Windows 2003 Server和2008 server 2003 server R2和2008 server R2操作系統。
請在輸入代碼樣本時使用代碼標籤,沒有人會嘗試讀取它當前的狀態。 – 2010-12-09 09:47:28